Skip to main content

MonoTouch set status bar hidden

By July 24, 2012December 18th, 2013Blog

If you ever needed to set the status bar hidden in Monotouch App, and wanted to do it properly for code that runs backward compatible on OS 3.X while developing on iOS SDK 4.X and also for newer devices, here is the answer:

 

if (UIApplication.SharedApplication.RespondsToSelector (new Selector ("setStatusBarHidden: withAnimation:")))
	UIApplication.SharedApplication.SetStatusBarHidden (true, UIStatusBarAnimation.Fade);
else
	UIApplication.SharedApplication.SetStatusBarHidden (true, true);