使用导航视图控制器在子视图之间导航

时间:2013-03-08 10:52:45

标签: ios cocoa-touch uinavigationcontroller addsubview

我有一个MainViewController,它覆盖了iPad上的整个屏幕,我有三个子视图,每个子视图都有框架=(0,0,1024,150)
所需的子视图配置和它们之间的segue正在故事板中完成 我想使用navigationViewController ...在屏幕顶部显示子视图 我正在使用此代码来执行此操作.....

UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:myViewController];
nvc.view.frame = CGRectMake(0, 0, 1024, 150);
[self.view addSubview:nvc.view];

myViewController是我想要在导航视图中的初始视图

代码工作正常只有我遇到的问题是视图不在其框架大小。他们全屏(1024/768)。

我可以做些什么来维护子视图的大小?

0 个答案:

没有答案
相关问题