没有故事板的xcode7,显示不正确

时间:2016-06-05 21:18:39

标签: objective-c storyboard xcode7 xib

我正在使用xCode7而我正在尝试不使用故事板。我已经从info.plist中删除了启动屏幕和主要故事板属性,并且我创建了一个正确链接到视图控制器的xib文件。在我的app委托中,我编写了以下代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

CGRect screenBounds = [[UIScreen mainScreen] bounds];

UIWindow *window = [[UIWindow alloc] initWithFrame:screenBounds];
ViewController *vc = [[ViewController alloc] init];
[window setRootViewController:vc];

[window makeKeyAndVisible];

[self setWindow:window];

return YES;

}

我的xib文件在编辑器中如下所示:

enter image description here

这些按钮用于显示顶部和底部。

在模拟器中它看起来像这样:

enter image description here

任何人都可以对此事提出一些看法吗?谢谢,P。

1 个答案:

答案 0 :(得分:0)

看起来您应该查看Top BarBottom Bar。确保没有。我希望这可以帮到你。

[viewController.navigationController setNavigationBarHidden:YES animated:YES];

[viewController.navigationController setToolbarHidden:YES animated:YES];

我没有在xcode上测试它,也许我的代码中有一些错误。 我希望这可以帮到你。