简体   繁体   中英

WebView shows on Android but not on iOS Xamarin Forms

this is my WebView

    <WebView x:Name="webview" Source="http://google.com" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" HeightRequest="500" >
        </WebView>

it's show on Android but not on ios,i also added

    <key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

to info.plist iOS but it dosen't work!what's problem?

Try these:

  1. Use https:// instead of http .

  2. give width too to the webview.

Above two should help, but even if above solutions doesn't work.try adding like this in info.plist

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>google.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>TLSv1.1</string>
        </dict>
    </dict>
</dict>
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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