Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin.forms, removing status bar in iOS 10

I'm using the following code in AppDelegate.FinishedLaunching to removing the status bar in iOS from my Xamarin forms app:

  UIApplication.SharedApplication.SetStatusBarHidden (true, UIStatusBarAnimation.None);

This does removes the space used by the status bar, but the contents of the status bar are still being rendered.

At the top of this image (my app in portrait mode, brightness enhanced), you can see the clock, battery indicator, et al. being drawn right over my app:

status bar drawn on top of my app

How do I get rid of this?

This is a Page in a Forms app that consists of a single SKCanvasView, if that's relevant.

like image 803
Mud Avatar asked Nov 20 '25 01:11

Mud


1 Answers

Add these options to your info.plist

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

Or

enter image description here

like image 191
Nick Peppers Avatar answered Nov 22 '25 16:11

Nick Peppers