Android開發之listview 的使用中Item獲取焦點的處理

 假如listview的item中有Button,ImageButton,CheckBox等會強制獲取焦點的view  
此時,listview的item沒法獲取焦點,從而沒法被點擊    
解決方法:給item的根佈局增長如下屬性    
android:descendantFocusability="blocksDescendants"    
設置以後,Button獲取焦點,item中其餘控件也能夠獲取焦點android

相關文章
相關標籤/搜索