如何正确从 ListAdapter 获取视图?
如何正确使用ListAdapter.getView(intposition,ViewconvertView,ViewGroupparent)方法? 我无法找出 ViewGroup 的期望。
从我得到的信息:
- position是我想要的元素编号
- convertView是我为布局中的项目定义的视图
- parent =?
How do I properly use ListAdapter.getView(int position, View convertView, ViewGroup parent) method?
I'm having trouble finding out what the ViewGroup expect.
From what I get:
- position is the element number that i want
- convertView is the View that I defined for the items in my layout
- parent = ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
父级是
ListView
(或其他类型的ViewGroup
),其数据由ListAdapter
提供。注意:您不应该直接调用此方法。它是一个
Adapter
接口方法,您通常在自己的BaseAdapter
子类中重写,以便您完全控制列表中每个项目的视图显示方式。parent is the
ListView
(or other type ofViewGroup
) whose data is being supplied by theListAdapter
.Note: You shouldn't really be calling this method directly. It is an
Adapter
interface method you typically override in your ownBaseAdapter
subclass to give you complete control over how the views are displayed for each item in the list.