Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 屏幕底部的空间(iOS 5)_Objective C_Xib - Fatal编程技术网

Objective c 屏幕底部的空间(iOS 5)

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

只有当我将状态栏隐藏在屏幕底部时,才会出现一个空格,如下所示:

但它不会出现在xcode中:

附言:这是第二个视图,我打开它:

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的答案了。