Mobile App Dev Diary

Android (Java, Kotlin), iOS (Swift), Xamarin (C#)

Xamarin.Forms / Prevent iOS statusbar is overwrapped

To avoid iOS statusbar is hidden by UI components, use this.

<?xml version="1.0" encoding="utf-8"?>
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:calc"
    x:Class="calc.calcPage">

    <!-- for iOS -->
    <!-- prevent statusbar is overwrapped -->
    <ContentPage.Padding>
        <OnPlatform x:TypeArguments="Thickness" iOS="0, 20, 0, 0" />
    </ContentPage.Padding>

</ContentPage>
Remove all ads