@Override
public View getView(int position,View convertView,ViewGroup parent) {
Person person=persons.get(position);
View list=View.inflate(MainActivity.this,R.layout.list_item,null);
TextView tv_id=(TextView) list.findViewById(R.id.tv_id);
TextView tv_name=(TextView) list.findViewById(R.id.tv_name);
TextView tv_account=(TextView) list.findViewById(R.id.tv_account);
tv_id.setText("id:"+person.getId());
tv_name.setText("姓名:"+person.getName());
tv_account.setText("金额"+person.getId());
return list;
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
TextView
android:id="@+id/tv_id"
android:layout_width
android:layout_height
android:layout_marginLeft="5dp"
android:text="ID"
android:textColor="#ff0000"
android:textSize="16sp" />
LinearLayout
android:layout_width="10dp"
android:orientation="vertical" >
TextView
="@+id/tv_name"
android:layout_width
android:layout_height
android:text="姓名"
android:textSize/>
="@+id/tv_account"="金额"
android:textColor="#50000000"/>
</LinearLayout>
>