Android ListView背景成透明设置方法
1、如果你只是换背景的颜色的话,可以直接指定android:cacheColorHint为你所要的颜色
2、如果你是用图片做背景的话,那也只要将android:cacheColorHint指定为(#00000000)就可以了
3、eg:如下XML文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/mainbg" //背景图片
>
<ListView
android:id="@+id/save_shwo_listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"//设置为透明色
>
</ListView>
</LinearLayout>