GetView 对比自定义 CursorAdapter 中的 BindView? [英] GetView Vs. BindView in a custom CursorAdapter?

查看:23
本文介绍了GetView 对比自定义 CursorAdapter 中的 BindView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在观看此视频 http://www.youtube.com/watch?v=N6YdwzAvwOA 和 Romain Guy 展示了如何使用 getView() 方法制作更高效的 UI 适配器代码.这也适用于 CursorAdapters 吗?我目前正在将 bindView()newView() 用于我的自定义光标适配器.我应该改用 getView 吗?

So, I'm watching this video http://www.youtube.com/watch?v=N6YdwzAvwOA and Romain Guy is showing how to make more efficient UI adapter code using the getView() method. Does this apply to CursorAdapters as well? I'm currently using bindView() and newView() for my custom cursor adapters. Should I be using getView instead?

推荐答案

CursorAdapter 有一个 getView() 的实现,委托给 newView()code> 和 bindView(),以强制行回收模式的方式.因此,如果您要覆盖 newView()bindView(),则无需对 CursorAdapter 执行任何特殊操作以进行行回收.

CursorAdapter has an implementation of getView() that delegates to newView() and bindView(), in such a way as enforces the row recycling pattern. Hence, you do not need to do anything special with a CursorAdapter for row recycling if you are overriding newView() and bindView().

这篇关于GetView 对比自定义 CursorAdapter 中的 BindView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆