GridView第一個Item中的CheckBox不工做

問題:如題html

解決辦法:java

修改後:android

ViewGroup.LayoutParams params =helper.getConvertView().getLayoutParams();
params.width=LayoutParams.MATCH_PARENT;
params.height=gridView.getWidth()/ROW_NUMBER

  

修改前:htm

AbsListView.LayoutParams params = new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, gridView.getWidth() / ROW_NUMBER);
helper.getConvertView().setLayoutParams(params);

 

 

參考:http://www.4byte.cn/question/337904/android-gridview-checkbox-of-the-first-item-not-work-when-i-recycled-convertview.htmlblog

相關文章
相關標籤/搜索