通过继承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"
/>
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。