Monotouch set status bar Hidden - API change secure

可紊 提交于 2019-12-07 05:06:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!