GetView比。 BindView在自定义的CursorAdapter? [英] GetView Vs. BindView in a custom CursorAdapter?
问题描述
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的()
和 bindView()
,作为强制行循环模式这样一种方式。因此,你不需要做什么特别的事情了的CursorAdapter
为行回收,如果要覆盖 NewView的()
和 bindView()
。
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比。 BindView在自定义的CursorAdapter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!