首页 > 移动平台 > 详细

Android:Adapter中设置多种type的item的LayoutParams导致的convertView复用异常的问题

时间:2016-08-01 17:42:48      阅读:456      评论:0      收藏:0      [点我收藏+]

http://stackoverflow.com/questions/12018997/why-does-getview-return-wrong-convertview-objects-on-separatedlistadapter#comment35496677_12288051

 

The recycle bin technically stores the convert views based on the type that was initially read from getItemViewType but is then saved to the view‘s LayoutParams object. If you overwrite the view‘s LayoutParams you will overwrite the view type and thus break the recycling! – user153275 Apr 21 ‘14 at 20:41  

 

代码中设置的layoutParams实用的是成员变量,会导致convertView的viewType混乱,出问题

Android:Adapter中设置多种type的item的LayoutParams导致的convertView复用异常的问题

原文:http://www.cnblogs.com/makebetter/p/5726447.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!