安卓开发中,遇到这样的情况,在某一列里面父类布局上有一些子类布局,点击父类布局触发事件, 由于父类是通过反射机制实现绑定的, 故只需要在父类布局定义
就可以满足, 同时看了下VIEW的API
只要不定义true,那么都是false,这样子类就不会影响到父类的点击触发事件了
android:clickable="true"
就可以满足, 同时看了下VIEW的API
public boolean isClickable ()
Added in API level 1
Indicates whether this view reacts to click events or not.
Related XML Attributes
android:clickable
Returns
true if the view is clickable, false otherwise
只要不定义true,那么都是false,这样子类就不会影响到父类的点击触发事件了