How to hide the status bar programmatically in iOS 7?

后端 未结 12 1791
眼角桃花
眼角桃花 2020-12-05 17:00

In ios7, how can I hide the statusbar programmatically? I am using XCode 4.6.1 (ios6.1) and I want to implement this in XCode itself.

12条回答
  •  感情败类
    2020-12-05 17:42

    My experience is that you need both the code and the value in the info.plist file in iOS 9 / Xcode 7.3.

    Add this to your viewDidLoad method.

    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    

    Add this to your info.plist file as a boolean value and set it to NO:

    View controller-based status bar appearance
    

提交回复
热议问题