Welcher Weg ist besser, um Android-Ansicht zu erstellen? durch Verwendung von XML oder Bay mit Java-Code in Aktivität?Welcher Weg ist besser, um Android-Ansicht zu erstellen?
Beispiel:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/account_bundle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@drawable/account"
android:orientation="vertical"
android:paddingBottom="10dp">
<LinearLayout
android:id="@+id/progress_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/account_progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_height="5dp"
android:layout_width="200dp"
android:paddingEnd="10dp"
android:layout_gravity="center|end"
android:layout_weight="4"
android:indeterminate="false"
android:max="100"
android:progress="80"
android:progressDrawable="@drawable/progress_bar"
android:textAlignment="center" />
</LinearLayout>
</LinearLayout>
ich die Wahl haben, diese mit Linearlayout XML und Java in meiner Tätigkeit zu schaffen, ich will jetzt die beste Lösung ist in der Bezeichnung der Leistung?
Eher hängt von Ihrer Verwendung ab .. Ich verwende beide Typen und habe fast keinen Unterschied in der Leistung gefunden –