问题
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?
回答1:
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);
来源:https://stackoverflow.com/questions/4067961/monotouch-set-status-bar-hidden-api-change-secure