由于ImageView默认是没焦点,不可点击的,所以要设置背景颜色,就必须要有如下代码:

1.如果组件只需要点击,那么就设置:

android:clickable="true"


2.如果组件还需要选中,那么就再加一个设置:

android:foucsable="true"