我有一个 ScrollView (contentScrollView),它稍后应该包含 20 个页面,每个页面都有一个 UIViewController。
现在这是我将 UIViewControllers 视图添加到 contentScrollView 时得到的(右上角的 Button 来自 MainViewController,因此不会影响问题)
我在我的 ContentScrollView所在的MainViewController类中得到了这段代码:
Slide1ViewController*test = [[Slide1ViewController alloc] init];
test.view.frame = CGRectMake(0, 0, 1024, 768);
[self.contentScrollView addSubview:[test view]];
当我在设置框架后立即添加这样的背景时:
test.view.backgroundColor = [UIColor blackColor];
然后我得到黑色背景,顶部没有那个 Bar,但 Slide1ViewController.xib 中的标签不会出现。
希望可以有人帮帮我。