Florian
Florian

Reputation: 5994

iOS status bar overlap

I'm using Xamarin Forms to build an iOS app. I've got the following structure:

- navigation page
-- tabbed page
--- content page
---- listview
--- content page

The result is the following:

enter image description here

How can I solve that. I know that there are quite a few duplicates but these are for xcode. I need it for xamarin forms?

I don't want to hide the status bar. I just want to status bar at the top and the bounds of the app right below. Setting the padding of root navigation page to 0,20,0,0 did not work.

 public partial class App : Application
 {
        public App()
        {
            InitializeComponent();

            ServiceLocator.Instance.Add<ICloudService, AzureCloudService>();
            var navigationPage = new NavigationPage(Pages.MainPage.Instance);
            navigationPage.Padding = new Thickness(0, 20, 0, 0);

            NavigationPage.SetHasNavigationBar(Pages.MainPage.Instance, false);

            MainPage = navigationPage;
        }
 }

UPDATE: I've also tried this one:

public App()
{
    InitializeComponent();

    ServiceLocator.Instance.Add<ICloudService, AzureCloudService>();
    var navigationPage = new NavigationPage(Pages.MainPage.Instance);
    Pages.MainPage.Instance.Padding = new Thickness(0, 20, 0, 0);

    NavigationPage.SetHasNavigationBar(Pages.MainPage.Instance, false);

    MainPage = navigationPage;
}

Upvotes: 0

Views: 1654

Answers (1)

Jesse Jiang
Jesse Jiang

Reputation: 965

You should set padding in ContentPage not NavigationPage

Upvotes: 1

Related Questions