私は Android Listview を使用しており、リストビュー項目の両側に 1px の仕切りが必要です。これは、2 つの異なる色の上下を意味します。しかし、問題は、下部に仕切りを表示するためにログインできないことです。試してみandroid:layout_below
ましたが、無効と表示されます。
これはリストビューのコードです
<ListView
android:id="@+id/myphnview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@drawable/dividerheight"
android:background="#E9EAEC"
android:clickable="true"
android:divider="@drawable/dividerheight" >
</ListView>
これは、上枠に使用している xml ファイルです。分割高さ.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="line" >
<stroke android:color="#c6c7c9" />
<size android:height="1px" />
</shape>
</item>
</layer-list>
これは私の行のレイアウトです
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rowlayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#E9EAEC"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2" >
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/ic_launcher"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1" >
<TextView
android:id="@+id/file_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_margin="5dp"
android:text="Hello Android "
android:textColor="@android:color/black"
android:textSize="20dp" >
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<ImageView
android:id="@+id/share_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="@drawable/ic_launcher"/>
</LinearLayout>
</LinearLayout>