1. 如果只是想把当前页面的状态栏隐藏的话,直接用下面的代码就可以了
[[UIApplication sharedApplication] setStatusBarHidden:TRUE];
2. 如果是想把整个应用程序的状态栏都隐藏掉,操作如下:
在info.plist上添加一项:Status bar is initially hidden,value为YES;
View controller-based status bar appearance 设置成NO;
完后在MainAppDelegate.mm的- (BOOL)application:(UIApplication
*)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions方法里面加上如下一句就可以了:
[[UIApplication sharedApplication]setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
网友评论