标签:
1.修改Info.plist文件 添加一个View controller-based status bar appearance 并设置为YES(这样viewcontroller设置状态栏的优先级高于[UIApplication shareApplication]设置状态栏的优先级)
2.在viewWillAppear中添加(网上看到是说在viewDidLoad中添加,试过之后没有效果)
UIView *statusBarView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 20)];
[self.view addSubview:statusBarView];
[self setNeedsStatusBarAppearanceUpdate];
3.添加方法
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
- (BOOL)prefersStatusBarHidden
{
return NO;
}
标签:
原文地址:http://www.cnblogs.com/moluoyunduan/p/4520217.html