使用ScrollView设置将其他View加进去,使用垂直滚动条,这样就可以一页就就可以包含多个内容。
self.viewControllers = [NSMutableArray arrayWithCapacity:0];
UIViewController* controller = nil;
controller = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
controller.view.frame = CGRectMake(1024*1, 0, 1024, 768);
[scrollView1 addSubview:controller.view];
[viewControllers addObject:controller];
controller = [[Second1ViewController alloc]initWithNibName:@"Second1ViewController" bundle:nil];
controller.view.frame = CGRectMake(1024*1,768*1, 1024, 768);
[scrollView1 addSubview:controller.view];
[viewControllers addObject:controller];
controller = [[Second2ViewController alloc]initWithNibName:@"Second2ViewController" bundle:nil];
controller.view.frame = CGRectMake(1024*1,768*2, 1024, 768);
[scrollView1 addSubview:controller.view];
[viewControllers addObject:controller];
/设置ScrollView 的大小
[scrollView1 setContentSize:CGSizeMake(1024*3,768*3)];
scrollView1.bounces = YES;