Ich möchte diese Benutzeroberfläche erstellen.Ich möchte diese Benutzeroberfläche in Android erstellen. Ich bin nicht in der Lage, Layoutposition und Speicherplatz
Arbeit
Ich bin nicht in der Lage das Layout einstellen position.and Ich möchte Polsterung zwischen den Elementen geben, nach „Arbeit“ UI. Ich verwende lineares Layout. Wie zeichne einfache kurze Linie Sortierung, Filter und Herz-Symbol. Ich benutze View. Ich habe das getan.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="drawable/sort" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SORT"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"
android:background="#706e6e" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="drawable/filter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FILTER"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rect_red"
android:text="NEW"
android:textColor="#FFFFFF"
android:textSize="14dp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"
android:background="#706e6e" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="drawable/heart" />
</LinearLayout>
</LinearLayout>
rect_red.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ff0000"></solid>
<padding
android:bottom="10dp"
android:left="25dp"
android:right="25dp"
android:top="10dp"></padding>
</shape>
Ich würde vorschlagen, Sie jede Tutorial über android Layouts vor allem anderen folgen. Beachten Sie, dass Sie kein zusätzliches ImageView benötigen, da Sie eine Verbindung festlegen können, die in Ihrem TextView gezeichnet werden kann. Sie können eine 1 Pixel breite Ansicht für die Trennzeichen verwenden. –