看看这个:Android Hive 链接
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:background="@drawable/listselect"
android:orientation="horizontal"
android:padding="5dip" >
<TextView
android:id="@+id/txtViewNameDAR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name : "
android:textColor="#040404"
android:textSize="15sp"
android:textStyle="bold"
android:typeface="sans" />
<TextView
android:id="@+id/txtViewVisitedCityDAR"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Type : "
android:textColor="#343434"
android:textSize="13sp" />
<TextView
android:id="@+id/textViewTypeDAR"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Visited City : "
android:textColor="#343434"
android:textSize="13sp" />
</RelativeLayout>
根据您的需要更改 ID 和颜色。
这是一个独立的 XML 文件。像下面这样使用它:
list.setAdapter(new ArrayAdapter<String>(this,
"R.Layout.ABOVE_XML_FILENAME, bible_list_one));
然后,在 getView
TextView text = (TextView) row.findViewById(" Your Desired textViewID");
text.setText(" ");
希望你能有所了解