How can I hide the status bar in a Monotouch application in such a way that it is backwards compatible on iOS 3.X while developing on iOS >= 4.X?
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With