方法一:初始化的时候在代码里面设置
gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));
方法二:
<GridView android:id="@+id/all_apps"
android:background="@drawable/application_background"
android:persistentDrawingCache="animation|scrolling"
android:alwaysDrawnWithCache="true"
android:scrollbars="none"
android:drawSelectorOnTop="false"
android:listSelector="@drawable/grid_selector"
android:numColumns="auto_fit"
android:columnWidth="78dp"
android:stretchMode="spacingWidth"
android:layout_weight="1.0"
android:layout_height="0dip"
android:layout_width="match_parent"
android:stackFromBottom="true"
android:visibility="invisible"
/>
在GridView属性中注意上面绿色的那一行.它指定了元素的背景布局文件为dwawable目录下面的grid_selector.xml文件.打开grid_selector.xml文件,有下面的描述:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/pressed_application_background_static" />
<item android:state_window_focused="false"
android:drawable="@drawable/focused_application_background_static" />
<item android:state_window_focused="true"
android:drawable="@drawable/focused_application_background_static" />
</selector>
http://blog.csdn.net/avatarliyu/article/details/7541556