จากตัวอย่าง การใช้งาน ListActivity เบื้องต้น เราสามารถสร้าง List รายการขึ้นมาได้แต่ List รายการดังกล่าว ยังดูไม่ค่อยน่าสนใจเท่าไหร่ วันนี้เราจะมาลองใส่รูปดูครับ ก่อนอื่นดูหน้าตาโปรแกรมที่เสร็จแล้วก่อนครับ
ทีนี้มาดูโค้ดกันบ้าง activity_main.xml
ทีนี้มาดูโค้ดกันบ้าง activity_main.xml
<ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" />row.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/row" android:layout_width="match_parent" android:layout_height="match_parent" android:drawableLeft="@drawable/ico_gear" android:drawablePadding="10dp" android:gravity="center_vertical" />