iOS 状态栏隐藏+变色
2016-08-05 本文已影响86人
古流风
改变状态栏颜色
iOS手机状态栏默认是黑色,在某些情况下需要改变状态栏的颜色
在info.plist文件中添加:View controller-based status bar appearance:NO

隐藏状态栏
//隐藏状态栏
if([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]){
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
-(BOOL)prefersStatusBarHidden{
return YES;
}
end