[英]layout issues when building an old app in xcode 6
我正在对一个旧的应用程序进行过一些更改,而该应用程序已经使用了两年以上。 我已在xCode 6中构建并运行该应用程序,并得到以下结果。
对于状态栏,我正在尝试以下操作:
- (void)viewDidLoad
{
[super viewDidLoad];
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
}
// Add this method
- (BOOL)prefersStatusBarHidden {
return YES;
}
我也试图将View controller-based status bar appearance
为NO
有人可以帮我吗? 我不使用情节提要,也不打算使用此应用程序。 它们都是单独的XIB文件。
提前致谢 !
编辑
添加此代码后:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.backgroundColor = [UIColor blackColor];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
我得到以下内容:
我的标签栏是在我的appdelegate中的代码中创建的:
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:homeNavigation,bookNavigation,doctorsNavigation,settingsNavigation,locatorNavigation,nil];
[self.window makeKeyAndVisible];
如果要启动状态栏下方的视图控制器,请尝试此操作(在viewDidLoad
方法中编写此代码)。
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
{
self.edgesForExtendedLayout=UIRectEdgeNone;
}
如果您想隐藏状态栏,请点击此链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.