系统什么时候调用adapter的getview函数
我想知道何时调用 getView 函数,如果我想刷新列表视图,但不知道该怎么做。比如,listView 中显示了 7 个项目,现在,我想将其更改为其他 7 个日期和图像。
I want to know when the getView function will be called, case I want to refresh the listview, and don't know how to do. something like, there are 7 items shown in a listView , and now , I want to change it to 7 other date and images.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您需要以编程方式滚动视图,可以使用 smoothScrollToPosition 但仅在 API 8 及更高版本中支持。
If you need scroll view programmatically, you can use smoothScrollToPosition but it supported only in API 8 and higher.
要刷新列表视图,
请调用编辑,
通常列表视图的列表项将具有相同的高度,如果您可以计算高度并调用,
即使很简单,
如果您知道
列表视图应呈现您在列表中添加的新项目的 位置,您也可以调用适配器(前提是您调用了notifydatasetchanged())
to refresh the listview call
EDIT
generally listview's list item will have same height if you can calculate the height and call
even simple you can call
if you know the position
the listview should render the new items you added in the adapter(provided you call the notifydatasetchanged())