Objective c 屏幕底部的空间(iOS 5)
只有当我将状态栏隐藏在屏幕底部时,才会出现一个空格,如下所示: 但它不会出现在xcode中: 附言:这是第二个视图,我打开它:Objective c 屏幕底部的空间(iOS 5),objective-c,xib,Objective C,Xib,只有当我将状态栏隐藏在屏幕底部时,才会出现一个空格,如下所示: 但它不会出现在xcode中: 附言:这是第二个视图,我打开它: UIViewController* flipViewController = [[UIViewController alloc] initWithNibName:@"GameController" bundle:[NSBundle mainBundle]]; [self.view addSubview:flipViewController.view]; 这是由于i
UIViewController* flipViewController = [[UIViewController alloc] initWithNibName:@"GameController" bundle:[NSBundle mainBundle]];
[self.view addSubview:flipViewController.view];
这是由于iOS 7的状态栏 在
viewDidLoad
中添加以下代码:
- (void)viewDidLoad
{
[super viewDidLoad];
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
}
看起来您已经考虑了状态栏。@Popeye您的意思是什么?在界面生成器中,您可以包括状态栏。通过选择要处理的.xib文件>>选择右侧的视图>>选择第四个选项卡,使其标题为“模拟度量”>>,应该有状态栏选项。@Popey,但我不想要状态栏。。。无论如何,如果我把它放在xib中可见,空间仍然存在。从技术上讲,这是错误的,但只是因为应该首先调用super。它说:“在GameController类型的对象上找不到属性edgesForExtendedLayout”。顺便说一句,我有xcode 4和iOS5@Mageek这是有道理的,因为iOS 7 API中有
edgesForExtendedLayout
,您可以将此细节添加到您的问题中,这样就没有其他人给出iOS 7的答案了。