viewHolder提升adaptor效率 ,ListView、BaseAdaptor总结
2014-02-25 18:00
435 查看
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的原理与解决多轮重复调用的方法--- /article/2780474.html
4、RecycleBin
参看android源码:android.widget.AbsListView.RecycleBin
5.如果不设置listview为固定大小(fillparent、XXdp) 将会出现多次调用getView方法-----"Never set the
your listview to
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
fixed width/height."
参考文章: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
2. OOM如果你的Item是自定义的Item的话,例如你的自定义Item布局ViewGroup中包含:按钮、图片、flash、CheckBox、
RadioButton等一系列你能想到的控件的话, 你要在getView中单单使用ViewHolder是远远不够的如果数据过多,加载的 图片过多过大,你BitmapFactory.decode的猛多的话,OOM!!!! ---出自http://mzh3344258.blog.51cto.com/1823534/889879
3、ListView中getView的原理与解决多轮重复调用的方法--- /article/2780474.html
4、RecycleBin
参看android源码:android.widget.AbsListView.RecycleBin
5.如果不设置listview为固定大小(fillparent、XXdp) 将会出现多次调用getView方法-----"Never set the
layout_heightand
layout_widthof
your listview to
wrap_contentas
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_parentor
fixed width/height."
参考文章: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
相关文章推荐
- 软件工程生命周期
- Maven依赖Scope标签用法
- Java 异常处理的一般结构
- 平时遇到问题简单总结
- RHEL6.4下安装qt-recordMyDesktop屏幕录像软件
- 性能提升
- First Phone Interview
- /boot/grub/menu.lst详解
- Foreach循环及For性能及使用上的比较
- 仿原天猫商城的导航
- javaSE-面向对象-构造代码块
- Android监听手机sdcard状态
- 软件工程术语
- 手机数据丢失找回办法
- makefile + shell脚本自动生成动态库
- Windows XP 与 Windows 2000 句柄表(增加个人注解)
- Spring MVC一个简单的实例
- 软件工程方法
- Spring MVC一个简单的实例
- 2014年值得学习的编程语言