码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2016-08-01 17:44:47      阅读:163      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!