閱讀324 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Android 關於嵌套listView時onItemClick事件不響應的解決辦法

原文:https://pxq19890719.iteye.com/blog/1168543

當我們使用listView嵌套button或者其它clickable控件時會出現listView的onitemClick事件不響應的問題。我們隻需要在item的xml文件中的根布局中加上一句: 

android:descendantFocusability="blocksDescendants"  

屏蔽item中搶奪focus的控件權限即可解決問題。


最後更新:2017-04-02 17:09:25

  上一篇:go 解決錯誤ERROR: No suitable Java found. In order to properly use the Android Developer Tools,…
  下一篇:go C語言處理圖像之改變背景前景顏色