ImageView set the Click Effect need to note two points, the first setting android:clickable= "true", the second <item android:drawable= "@drawable/button_n"/> Attribute must be placed last to take effect
<?xml version= "1.0" encoding= "Utf-8"?><!--Find large class list items--><imageview xmlns:android= "/http/ Schemas.android.com/apk/res/android " android:id=" @+id/ivcategory " android:layout_width = "@dimen/x110" android:layout_height= "@dimen/x110" android:src= "@drawable/bt_ ICON_PXB " android:clickable=" true " android:background=" @drawable/bt_discover_ Category "></ImageView>
<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/ Android "> <item android:drawable=" @drawable/button_d "android:state_checked=" true "/> <item android:drawable= "@drawable/button_d" android:state_pressed= "true"/> <item android:drawable= "@drawable /button_n "/></selector>
Android ImageView Click Effect