Android 如何在列表视图中显示背景图片?
How to show background image in a list view in Android?
当我创建列表视图时,背景变成白色。
我想在我的背景图片上显示列表视图,以便显示背景图片。我的列表视图已创建且工作正常,但它显示的背景图像为白色。
试试这个方法:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id = "@+id/listQueue"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:background = "@drawable/background" //change this to your image
android:divider="@drawable/separator"
android:scrollingCache="false"/>
</RelativeLayout>
当我创建列表视图时,背景变成白色。
我想在我的背景图片上显示列表视图,以便显示背景图片。我的列表视图已创建且工作正常,但它显示的背景图像为白色。
试试这个方法:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id = "@+id/listQueue"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:background = "@drawable/background" //change this to your image
android:divider="@drawable/separator"
android:scrollingCache="false"/>
</RelativeLayout>