清晰的WebView内容清晰、内容、WebView

2023-09-06 13:30:55 作者:深情喂冷风

我在我的应用程序中的web视图与WRAP_CONTENT宽度和高度

i have a WebView in my app with wrap_content width and height

我使用webview.loadData,的是0的宽度和高度之前,

before i use webview.loadData , the width and height of the it was 0 ,

在我打开一个网址(或我使用webview.loadData),它会显示一个网页。

after i load a url(or i use webview.loadData) , it'll display a web page.

我的问题是,如何清除web视图,以回恢复到原来的状态,就像

my question is , how can i clear the webview to recover it back to the original state, just as

在它??

推荐答案

我发现这个答案pretty的帮助:How做我清除的WebView内容加载页面之前?

i found this answer pretty helpful: How do I clear a WebView's content before loading a page?

对于可可但是基本上只要致电:

was for cocoa but basically just call:

webView.loadUrl("about:blank")