java代码:
rowView = LayoutInflater.from(context).inflate(R.layout.item, null);
TextView nameView = (TextView)rowView.findViewById(R.id.nameId);
R.layout.item xml文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:paddingBottom="4dip"
android:paddingLeft="12dip"
android:paddingRight="12dip">
<!-- <ImageView
android:paddingTop="12dip"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ItemImage"
/> -->
<TextView
android:layout_height="wrap_content"
android:textSize="20dip"
android:layout_width="fill_parent"
android:id="@+id/nameId"
/>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="@+id/nameId"
android:id="@+id/textId"
/>
</RelativeLayout>