2012-10-08 43 views
0

我正在構建一個在頂層具有TabBarController的應用程序。包含在其中一個選項卡中有一個tableview,當選中一行時,我想要轉到一組5個視圖,通過UIScrollViewDelegate和UIPageControl進行控制。將UIPageControl嵌入到TabBarController堆棧中

我已經建立了一個基本的應用程序與UIScrollViewDelegate和UIPageControl,基於德里克Bredensteiner在這個答案代碼:How do I use UIPageControl to create multiple views?

它工作正常,作爲一個獨立的應用程序,即:當視圖控制器代碼從直接調用通過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]; 
+0

我設法通過添加一個新的窗口屬性來使它工作@property(nonatomic,retain)IBOutlet UIWindow *窗口;但聽起來不對。 AppDelegate上有一個窗口屬性,現在又有一個屬性向下。 – ardochhigh

回答

0

我設法得到它加入了新的窗口屬性@property工作(非原子,保留)IBOutlet中的UIWindow *窗口;但聽起來不對。 AppDelegate上有一個窗口屬性,現在又有一個屬性向下。