在进入全屏模式的时候,顶部的statusbar 进行了隐藏,但是顶部任然有一个20像素的横条;
测试过程中仅仅在ios 4中会出现这种问题,在网上搜索到的很多答案都是采用, xx-Info.plist 里面加入
然后在需要加载statusbar的地方加入
[[UIApplication sharedApplication] setStatusBarHidden:NO];
经过分析,在viewController的底部采用的是一个 UINavigationViewContrller,而这里采用的是直接从控件列表拖拽到IB设计的地方;然后与mainVIewController进行关联。
而在采用纯代码去实现这一个过程后重新测试时,上面的蓝色横条消失了,如此经过测试可以发现这应该是系统的bug,所以建议还是采用纯代码的方式实现这一个过程,不要直接拖拽UINavigatiopnViewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; UINavigationController *navigation = [[[UINavigationController alloc]initWithRootViewController:self.viewController] autorelease]; [navigation setNavigationBarHidden:YES animated:NO]; self.window.rootViewController = navigation; [self.window makeKeyAndVisible]; return YES; }