我正在构建一个在顶层有一个 TabBarController 的应用程序。Contained within one of the tabs there is a tableview, and when a row is selected, I'd like to go to a set of 5 views, controlled via a UIScrollViewDelegate and UIPageControl.
我已经使用 UIScrollViewDelegate 和 UIPageControl 构建了一个基本应用程序,基于 Derek Bredensteiner 在此答案中的代码:如何使用 UIPageControl 创建多个视图?
它可以作为一个独立的应用程序正常工作,即:当 ViewController 代码通过 AppDelegate 直接调用时:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
但是当我尝试从我的 tableview 代码中调用相同的代码时,我得到了一个黑屏。我也尝试过使用presentModelViewController并得到 UIPageViewControl 点,但其余部分是黑色的。
LearnPageViewController *phoneContentController = [[LearnPageViewController alloc] init] ;
// [self presentModalViewController:phoneContentController animated:YES];
[self.navigationController pushViewController:phoneContentController animated:YES];