0

我正在构建一个在顶层有一个 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];
4

1 回答 1

0

我设法通过添加一个新的窗口属性 @property (nonatomic, retain) IBOutlet UIWindow *window; 让它工作。但这听起来不对。AppDelegate 上有一个窗口属性,现在又有一个 2 级。

于 2012-10-28T12:41:18.933 回答