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

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混乱,出问题

posted @ 2016-08-01 16:58  MakeBetter  阅读(349)  评论(0编辑  收藏  举报