Webview总是在ios Xamarin.Forms中返回黑屏 [英] Webview always return blank screen in ios Xamarin.Forms

查看:130
本文介绍了Webview总是在ios Xamarin.Forms中返回黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码示例加载具有https协议的页面,但无法使其正常工作:

I'm using this code sample to load a page with https protocol, but I'm unable to make it work: https://github.com/TheRealAdamKemp/AuthenticatedWebView

我使用" https://www.google.com 作为网页,但没有使用.我还尝试在Info.plist中添加应用程序安全权限".我总是得到空白页.

I'm using "https://www.google.com" as web page but nothing. I've also tried to add App Security Permission in Info.plist. I always get a blank page.

有人可以向我解释为什么吗?

Can anyone explain to me why?

推荐答案

如果您响应WebView.Navigating事件,请确保不要将其args.Cancel设置为true(如果加载的页面是WevView.Source). WebView.Navigating的iOS实现在加载WebView.Source时触发,而Android实现则不触发.如果在相关页面为WebView.Source时将args.Cancel设置为true,则WebView将为空白.

If you are responding to the WebView.Navigating event, be sure to not set its args.Cancel to true if the page loaded is the WevView.Source. The iOS implementation of WebView.Navigating fires when the WebView.Source is loaded but the Android implementation does not. If you set args.Cancel to true when the page in question is the WebView.Source, the WebView will be blank.

这篇关于Webview总是在ios Xamarin.Forms中返回黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆