通过继承ExpandableListActivity实现了一个二级列表,而子列表存在TextView和CheckBox组件,这里就存在一个问题,点击子列表项发现onChildClick方法并没有调用,搜索才发现是CheckBox的ListView失去焦点了。最后通过把CheckBox的焦点给释放了android:focusable="false" 就可以了。 方法如下: <CheckBox android:layout_width="match_parent" android:layout_height="18dp" android:id="@+id/caculated" android:layout_weight="27" android:checked="true" android:textColor="@color/colorScorexml" android:focusable="false" />
|