Android中ListView无法点击

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

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

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

同时,对Button等控件需要加入 
Java代码  Android中ListView无法点击
  1. android:focusable="false"  

相关文章:

  • 2021-04-15
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2021-05-19
猜你喜欢
  • 2021-09-21
  • 2022-12-23
  • 2021-09-16
  • 2021-12-29
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案