How to allow for iOS status bar and iPhone X notch in Xamarin.Forms

后端 未结 3 856
心在旅途
心在旅途 2021-01-02 19:48

I\'m fairly new to this, so sorry if this is a dumb question. How do I get my Xamarin.Forms app to start below the status bar or the notch when applicable? I\'ve tried using

3条回答
  •  -上瘾入骨i
    2021-01-02 20:36

    use UseSafeArea

    using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
    using Xamarin.Forms;
    
    namespace iPhoneX 
    {
        public partial class ItemsPage : ContentPage
        {
            public ItemsPage()
            {
                InitializeComponent();
    
                On().SetUseSafeArea(true);
            }
        }
    }
    

提交回复
热议问题