问题
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