Android: Disable highlighting in GridView
AndroidGridviewClickHighlightingAndroid Problem Overview
How can I turn off the orange highlight when clicking an item in a GridView?
I haven't been able to find a solution in the documentation or through testing.
Android Solutions
Solution 1 - Android
Use android:listSelector="#00000000"
in your GridView
element in your XML layout file.
Solution 2 - Android
Another option is to reference the transparent color via @android:color/transparent
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/grid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:listSelector="@android:color/transparent"
/>
Solution 3 - Android
I did the same thing in code using
GridView.setSelector(new ColorDrawable(Color.TRANSPARENT));
Solution 4 - Android
Add this property to gridview
android:listSelector="@android:color/transparent"
Solution 5 - Android
<GridView
android:id="@+id/gridView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:horizontalSpacing="10dp"
android:listSelector="#00000000"
android:numColumns="3"
android:scrollbars="none"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
Done! this is a solution. thank you :)
Solution 6 - Android
Try It...
android:listSelector="@android:color/transparent"
Solution 7 - Android
Just set below property in your XML file.
android:focusableInTouchMode="false"
Solution 8 - Android
Add android:listSelector="#00000000"
or android:listSelector="@android:color/transparent"
in your GridView XML element like bellow.
<GridView
android:id="@+id/gridView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="150dp"
android:gravity="center"
android:listSelector="#00000000"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" />