1. 如果只是想把當(dāng)前頁面的狀態(tài)欄隱藏的話肯骇,直接用下面的代碼就可以了
[[UIApplication sharedApplication] setStatusBarHidden:TRUE];
2. 如果是想把整個(gè)應(yīng)用程序的狀態(tài)欄都隱藏掉窥浪,操作如下:
在info.plist上添加一項(xiàng):Status bar is initially hidden,value為YES笛丙;
View controller-based status bar appearance?? 設(shè)置成NO;
?
完后在MainAppDelegate.mm的- (BOOL)application:(UIApplication
*)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions方法里面加上如下一句就可以了:
[[UIApplication sharedApplication]setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];