1

我有一个 MainViewController 覆盖 iPad 上的整个屏幕,我有三个子视图,每个子视图都有 frame = (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)。

我能做些什么来保持子视图的大小?

4

0 回答 0