我想在我的應用程序中添加一個背景圖片到listActivity。但是,使用背景圖像的代碼顯示在每一行上而不是整個列表中。在Android中添加背景圖像到列表視圖?
這是XML文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="8px" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/qbg1"/>
<TextView
android:id="@+id/employeeID"
android:layout_width="50px"
android:layout_marginRight="20px"
android:layout_height="wrap_content"
android:textColor="@color/textColor"/>
<TextView
android:id="@+id/employeeName"
android:layout_width="wrap_content"
android:layout_marginRight="10px"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/employeeID"
android:textColor="@color/textColor"/>
</RelativeLayout>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/qbg1"/>
是什麼背景圖像添加到活動的最佳方法?我寧願在XML文件中執行,而不是通過編程方式。
[ListView的背景圖片]的可能重複(http://stackoverflow.com/questions/5137898/listview-with-background-image ) – Snicolas