0

i have put a webview, Anroid is working fine but on IOS, when i scroll, i see the content scrolling behind the transparent status bar. Click and see the top left corner of the image

i have tried using safari related css adding margins and paddings but its not working

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        var browser = new WebView();
        browser.Source = "https://xxxxxxxxxxxxxxxx.net/";
        Content = browser;
    }
}

i expect that the status bar goes opaque and scrolled content doesn't show behind the status bar.

1
  • Hi ,have you solved it ? Commented Oct 23, 2019 at 6:06

1 Answer 1

0

This reason results from Safe Area in IOS devices . Refering to Safe Area Layout Guide on iOS , you can set safe area be true in Xamarin Forms:

<ContentPage ...
             xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
             Title="Safe Area"
             ios:Page.UseSafeArea="true">
    <StackLayout>
        ...
    </StackLayout>
</ContentPage>

My content page is as follow :

public MainPage()
{
    InitializeComponent();

    var browser = new WebView();
    browser.Source = "https://learn.microsoft.com/en-us/appcenter/test-cloud/starting-a-test-run";
    Content = browser;
}

The final effect :

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.