在iOS上预装Xamarin Forms中的WebView

时间:2016-01-06 01:25:37

标签: ios webview xamarin xamarin-forms

我在ContentPage中有一个WebView,我正在实例化并在构造函数中将url设置为WebView。然后我将使用PushModalAsync显示此ContentPage。事实上,在我执行Push之前,WebView似乎没有尝试加载。有没有办法让它在后台预加载而不是等到它显示出来?

1 个答案:

答案 0 :(得分:1)

您可以使用HttpClient获取内容,然后使用html数据加载WebView

WebView.Source =  new HtmlWebViewSource() { BaseUrl = urlPreloaded, Html = httpClientData}

通过这种方式,html数据将被预加载。

相关问题