简体   繁体   English

Xamarin Forms - 网址未显示在 Webview 中

[英]Xamarin Forms - Url not displaying in Webview

We are trying to display a URL in a webview in iOS and the page doesn't load, it only goes gray.我们试图在 iOS 的 webview 中显示一个 URL,但页面没有加载,它只会变灰。 I unfortunately can't share the Url.不幸的是,我无法分享网址。 but it is an Https Url.但它是一个 Https 网址。 It displays Google's website though.不过它显示了谷歌的网站。

We've added the NSAppTransportSecurity to the info.plist and are allowing ArbitraryLoads.我们已将 NSAppTransportSecurity 添加到 info.plist 并允许任意加载。 We've also added the domain to NSExceptionDomains.我们还将域添加到 NSExceptionDomains。

All the Webviews for iOS are making use of WKWebviews. iOS 的所有 Webviews 都使用 WKWebviews。

Any help will be greatly appreciated.任何帮助将不胜感激。 Will provide as much info as I can, but as mentioned, I can unfortunately not share the Url.将提供尽可能多的信息,但如上所述,遗憾的是我不能分享网址。

*Edit: When I added the Url to the Brower on the iOS device, it did load. *编辑:当我将 Url 添加到 iOS 设备上的浏览器时,它确实加载了。 It just doesn't load on the device它只是没有加载到设备上

Thank you谢谢

If your URL have IP Address then you have to add your URL in NSExceptionDomains.如果您的 URL 有 IP 地址,那么您必须在 NSExceptionDomains 中添加您的 URL。

You can check the NSExceptionDomains here : App Transport Security您可以在此处检查NSExceptionDomainsApp Transport Security

Please let me know if that might help or you are still facing the issue.请让我知道这是否有帮助,或者您仍然面临这个问题。 Thanks谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM