Method One, set when the control is initialized
Gridview.setselector (new colordrawable (color.transparent)); Listview.setselector (New Colordrawable (color.transparent));
Method Two, set the Listselector property in the layout file
<GridViewAndroid:listselector= "@android: Color/transparent"Android:numcolumns= "Auto_fit"Android:columnwidth= "50DP"Android:stretchmode= "Spacingwidth"Android:layout_weight= "1.0"Android:layout_height= "0dip"Android:layout_width= "Match_parent"/><ListViewAndroid:listselector= "@android: Color/transparent"Android:layout_height= "Match_parent"Android:layout_width= "Match_parent"/>
Of course, you can also customize the effect you want.
It is recommended to use method two to decouple the logic code from the layout file.
This article transferred from: http://www.android100.org/html/201305/24/2734.html
Android-the effect of canceling Gridview/listview item when clicked