viewHolder提升adaptor效率 ,ListView、BaseAdaptor总结

1.使用static 的ViewHolder 可以优化ListView性能近50%  

2. OOM如果你的Item是自定义的Item的话,例如你的自定义Item布局ViewGroup中包含:按钮、图片、flash、CheckBox、       RadioButton等一系列你能想到的控件的话, 你要在getView中单单使用ViewHolder是远远不够的如果数据过多,加载的 图片过多过大,你BitmapFactory.decode的猛多的话,OOM!!!! ---出自http://mzh3344258.blog.51cto.com/1823534/889879

3、ListView中getView的原理与解决多轮重复调用的方法--- http://blog.csdn.net/hupuxiang/article/details/7420674

4、RecycleBin 参看android源码:android.widget.AbsListView.RecycleBin   

5.如果不设置listview为固定大小(fillparent、XXdp) 将会出现多次调用getView方法-----"Never set        the layout_height and layout_width of your listview to wrap_content as getView() will force your adapter to get some child    for measuring the height of the views to be drawn in list view and can cause some unexpected behaviour like returning  convertview even the list is not scrolled.always use match_parent or fixed width/height."

enter image description here






参考文章:eoe: Adapter中getView参数convertView问题 : http://www.eoeandroid.com/thread-319764-1-1.html

                  ViewHolder模式: http://blog.csdn.net/djcken/article/details/7658871

stackoverflow: http://stackoverflow.com/questions/11945563/how-listviews-recycling-mechanism-works

    ListView recycleler机制详解:http://cmsbai.blog.51cto.com/330479/1184272

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值