Iphone X Xamarin, the top bar is superimposed

1

I'm trying to find out the Iphone model from xamarin, because with the iphone X my application is superimposed with the top part of the screen (where the battery and signal appears) Try various meds like this plugin but only returns me "Iphone" does not tell me if it is 7.8 or X. And I need it so if it is the iPhone X put a greater upper margin

that's how I'm left with the Iphone X, the battery icon seems to be ahead of the menu

And so it appears on the Iphone 8 (which is fine)

I also checked the Use SAfe Area Layout Guide as I read in several places, but I do not change anything

and the code that I have to start the view is:

case Device.iOS:
                {
                    BaseLayout = new RelativeLayout
                    {
                        Padding = new Thickness(0, 20, 0, 0),
                        Margin = new Thickness(0, 20, 0, 0),
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                    };
                    break;
                }
    
asked by Ariel Octavio D'Alfeo 27.03.2018 в 20:02
source

1 answer

2

I managed to fix it by adding SetUseSafeArea(On<Xamarin.Forms.PlatformConfiguration.iOS>(), true)

case Device.iOS:
    { Xamarin.Forms.PlatformConfiguration.iOSSpecific.Page.SetUseSafeArea(On<Xamarin.Forms.PlatformConfiguration.iOS>(), true);
                    BaseLayout = new RelativeLayout
                    {
                        Padding = new Thickness(0, 0, 0, 0),
                        Margin = new Thickness(0, 0, 0, 0),
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                       VerticalOptions = LayoutOptions.EndAndExpand,
                    };
                    break;
                }
    
answered by 28.03.2018 в 15:01