ListView中的Button点击设置

来源:互联网 发布:mac按键精灵使用教程 编辑:程序博客网 时间:2024/06/05 20:10

 

在ListView的Item中,如果有Button控件,那么要实现Button和Item点击都有响应,可以将Item的Layout中Button的focusable属性设为false,然后设置layout的属性android:descendantFocusability="blocksDescendants"。

代码如下:

 

原创粉丝点击