0

I have submitted for review update for my xamarin.ios app. Review team declined my app due to " Your app was not optimized to support the iPhone X and later device screen size or resolution. The iOS status bar overlapped the app’s UI elements." (screen below)

enter image description here

But I can't reproduce this error on simulator. It seems ok on virtual device (screen below). enter image description here

This error appeared after updating Visual Studio 2019 and I have no idea how to debug and fix this error.

Tat Leb
  • 11
  • 1
  • 3

2 Answers2

0

You have to enable safe area inset for supporting notch devices like iPhone X, XR, XS and 11. try this code :

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
...

On<iOS>().SetUseSafeArea(true);
Manav
  • 2,284
  • 1
  • 14
  • 27
0

You can have a try with setting safeArea to check whether it works.

About Xamarin.iOS could refer to safeAreaLayoutGuide from Apple document, then there is another similar discussion about navitve iOS how to achieve that, you also can refer to do the same in Xamarin.iOS.

Here is the Xamarin.iOS sample code for reference:

public override void ViewDidAppear(bool animated)
{
    base.ViewDidAppear(animated);
    
    //suberView is your subview view in ViewController
    View.Add(suberView);
    suberView.TranslatesAutoresizingMaskIntoConstraints = false;

    var safeGuide = View.SafeAreaLayoutGuide;
    suberView.LeadingAnchor.ConstraintEqualTo(safeGuide.LeadingAnchor).Active = true;
    suberView.TrailingAnchor.ConstraintEqualTo(safeGuide.TrailingAnchor).Active = true;
    suberView.TopAnchor.ConstraintEqualTo(safeGuide.TopAnchor).Active = true;
    suberView.BottomAnchor.ConstraintEqualTo(safeGuide.BottomAnchor).Active = true;

    View.LayoutIfNeeded();
}
Junior Jiang
  • 12,430
  • 1
  • 10
  • 30