このUIを作成します。アンドロイドでこのUIを作成したいです。使用できませんレイアウトの位置とスペース
仕事は私がレイアウトを設定することはできませんよposition.and私は「仕事」UIに応じて項目間のパディングを与えたいです。私は線形レイアウトを使用しています。単純な短い行のソート、フィルター、および心臓のアイコンを描く方法。 View.Iを使っています。
<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>
を助けることを願っています。テキストビューに複合ドロアブルを設定できるので、追加のImageViewは必要ありません。セパレータには1ピクセル幅のビューを使用できます。 –