As shown here we can leave space for the iOS status bar by using SetUseSafeArea
.
But is there something similar for a Xamarin.iOS app that is not a Xamarin.Forms app?
As shown here we can leave space for the iOS status bar by using SetUseSafeArea
.
But is there something similar for a Xamarin.iOS app that is not a Xamarin.Forms app?
First, you can 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();
}
If you are using native, I think the UIView has something very similar. UseSafeArea or something similar. You should be able to search developer.apple.com for UIView and it should provide something for you to enable.
EDIT: Just noticed SushiHangover's comment. Click on the link Sushi provided and it will show you.