WebView in RecyclerView will flash when notifyDataSetChanged

依然范特西╮ 提交于 2019-12-12 00:56:14

问题


I have a WebView in my RecyclerView, whenever I call RecyclerView.notifyDataSetChanged the WebView will have a short flashing.

I don't want any changes happen on the WebView, how can I do this ?

I know I can solve this with using notifyItemXXX instead of notifyDataSetChanged. But I do need notifyDataSetChanged method.


回答1:


As the notifyDataSetChanged() official doc says "LayoutManagers will be forced to fully rebind and relayout all visible views.". So I think the webview's flash is caused by this. And you can find this "Rely onnotifyDataSetChanged() as a last resort.". As you mentioned you must use this method, so can you please give more info so I can help you to find out a better solution.



来源:https://stackoverflow.com/questions/38626466/webview-in-recyclerview-will-flash-when-notifydatasetchanged

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!