Android中ListView无法点击

 

 

Android中ListView无法点击

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

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

解决方案: 
如果ListView子视图中有Button等抢焦点的控件,那么需要在ListView的xml配置中加入
Java代码  收藏代码
  1. android:descendantFocusability="blocksDescendants"  

同时,对Button等控件需要加入 
Java代码  收藏代码
  1. android:focusable="false"  
posted @ 2016-06-24 15:26  cheneasternsun  阅读(494)  评论(0编辑  收藏  举报