if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
//Added on 19th Sep 2013
self.window.bounds = CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height);
}
第一步 在項目的Info.plist 文件中 添加一行屬性配置
View controller-based status bar appearance =NO
這個設置爲:View Controller 不對status Bar 顯示進行操作
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
( BOOL )application:(UIApplication
*)application didFinishLaunchingWithOptions:( NSDictionary
*)launchOptions { self .window
= [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; if
([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { [application
setStatusBarStyle:UIStatusBarStyleLightContent]; self .window.clipsToBounds
= YES ; self .window.frame
= CGRectMake(0,20, self .window.frame.size.width, self .window.frame.size.height-20); //added
on 19th Sep self .window.bounds
= CGRectMake(0, 20, self .window.frame.size.width,
self .window.frame.size.height); } |