Xamarin.forms Xamarin Webview工作不正常
我正在构建xamarin.forms应用程序,打算在其中加载web视图(iOS)中的asp.net mvc应用程序。这是我的密码Xamarin.forms Xamarin Webview工作不正常,xamarin.forms,Xamarin.forms,我正在构建xamarin.forms应用程序,打算在其中加载web视图(iOS)中的asp.net mvc应用程序。这是我的密码 WebView webview = new WebView(); webview.Source = new UrlWebViewSource { Url = "https://hrworksplus.com/test/test.html" }; MainPage = new Con
WebView webview = new WebView();
webview.Source = new UrlWebViewSource
{
Url = "https://hrworksplus.com/test/test.html"
};
MainPage = new ContentPage
{
Content = webview
};
当我给出我的应用程序的url时,emulator不会加载任何东西,但如果我给出google.com链接,它马上就能正常工作。如果不知道会出现什么问题,我的web应用程序可以在浏览器中运行
问候
TA文件中的更改info.plist:
<key>NSAppTransportSecurity</key>
<dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads
解决了在iOS设备上的xamarin.forms Webview中播放html5视频的问题。
正如Gerald Versluis所说,在调试控制台中会出现一条关于连接不安全的错误消息,而视频不会播放。仔细检查输出日志,查看是否存在与连接不安全(足够)有关的错误。要进行验证,请将其放入
info.plist
文件中<代码>NSAppTransportSecurity NSAllowsArbitraryLoads。如果加载了SSL,则说明您的站点SSL连接有问题。