Gallery 闪烁通知 Gallery BaseAdapter 中的数据集已更改
我是安卓新手。我正在创建一个 webview 画廊,我必须在 BaseAdapter 中显示 200 个 webview 内容。我不想将所有 200 个 webview 一起加载。因此,在画廊的幻灯片上,我将每个 webview 添加到 BaseAdapter 并删除显示的 webview,然后我将使用“notifydatasetchanged ()”刷新 BaseAdapter
这里我面临的问题是;当我在“notifydatasetchanged()”上更新 BaseAdapter 时,图库会刷新,刷新图库时会闪烁。我想消除刷新 BaseAdapter 时的闪烁。是否可以 ?
提前致谢 :)
I am new to Android. I am creating a gallery of webviews, there I have to show 200 webview content in the BaseAdapter. I do not want to load all the 200 webviews together. So on slide of the gallery I will add each webviews to BaseAdapter and will remove the shown webviews, then I will refresh the BaseAdapter with "notifydatasetchanged ()"
Here the issue Im facing is; when I update the BaseAdapter on "notifydatasetchanged()" the gallery gets refreshed, At the moment of refreshing the gallery get blinks. I want to remove the blinking on refreshing the BaseAdapter. Is it Possible ?
Thanks in Advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚在我的应用程序中更正了它:)
我会尝试用我传奇的英语来解释。
BaseAdapter.notifyDataSetChanged()
为所有显示的视图调用Adapter.getView(...)
。所以你只需要在你的 Overridden 方法中处理它(在我的例子中,我把一个业务对象放在 view.Tag 中):
我希望它能在 3 年后帮助别人:)
I just corrected it in my app :)
I will try to explain with my legendary English.
BaseAdapter.notifyDataSetChanged()
callsAdapter.getView(...)
for all displayed views.So you just have to handle it in your Overridden method (in my case i put a business object in view.Tag) :
I hope it will help someone even 3 years later :)