Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Issue with WebView and orientation change

$
0
0

Hi,

I have a strange issue: I created a simple WebView which is added to the center of a relative layout.
My view code looks like this:

var htmlTest = new WebView
{
    Source = new HtmlWebViewSource()
    {
        Html = "<html style='height:100%'>" +
                "<body style='height:100%;margin:0'>" +
                "<div style='height:100%;text-align:center;'>" +
                    "<span style='font-size:20px;'><strong>TEST</strong></span>" +
                "</div>" +
                "</body>" +
                "</html>"
    }
};

Now if I run this on the iOS simulator, I have very strange orientation change behaviour. Depending on if the app starts up in portrait or landscape mode, it looks like this:

Portrait -> Landscape -> Portrait
image

Landscape -> Portrait -> Landscape
image

It looks like the bounds of the HTML view are not updated for some reason. But on Android this example works fine.
Any ideas what is causing this?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>