有時候我們點擊gridview時,item有選中效果,背景是黃色,去掉這一效果需要:
1、在drable新建xml文件,並在gridview裏面用lisetselector引用
android:listSelector="@drawable/grid_selector"
2、定義內容
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/back_white"
android:state_pressed="true"/>
<item
android:drawable="@drawable/back_white"
android:state_window_focused="false"/>
<item
android:drawable="@drawable/back_white"
android:state_window_focused="true"/>
</selector>
</animation-list>