Stay Hungry, Stay Foolish

发现ExpandableListActivity的onChildClick方法失效

android 4836℃ 0评论

通过继承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"
 />
喜欢 (2)
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦


Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in C:\inetpub\wordpress\wp-content\themes\XHBlog\comments.php on line 17
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址