在ListView的item的xml配置文件的根节点添加属性:
android:descendantFocusability="blocksDescendants"
并且在要添加事件的子控件(如button)的属性里添加
android:focusable="false"
此时最好去继承BaseAdapter来重写Adapter,不要用系统自带的Adapter。
在ListView的item的xml配置文件的根节点添加属性:
android:descendantFocusability="blocksDescendants"
并且在要添加事件的子控件(如button)的属性里添加
android:focusable="false"
此时最好去继承BaseAdapter来重写Adapter,不要用系统自带的Adapter。