Android中ListView无法点击

来源:互联网 发布:软件需求分析说明书 编辑:程序博客网 时间:2024/05/18 01:42


问题描述: 
ListView中Item加入Button后,导致ListView无法点击。 

解决方案: 
如果ListView子视图中有Button等抢焦点的控件,那么需要在ListView的xml配置中加入

Java代码  收藏代码
  1. android:descendantFocusability="blocksDescendants"  

同时,对Button等控件需要加入 
Java代码  收藏代码
  1. android:focusable="false"  



转自:http://xqjay19910131-yahoo-cn.iteye.com/blog/1319502