我有一個應用程序,通過導航控制器內的一組屏幕,然後有一個選項卡控制器,其中一個包含的視圖要顯示一個模式視圖控制器應該是顯示在整個應用程序的頂部(儘管不是全屏)。UINavigationController重疊了一個ModalViewController
這一切都工作正常,但模式窗口部分覆蓋在導航控制器的頂部。我已經嘗試使用self/self.tabBarController/self.navigationController/self.tabBarController.navigationController來調用presentModalViewController,但它們要麼不工作,要麼仍然顯示下面的模式窗口。
我一直在尋找這一整天的答案,其他人似乎有問題,當它重疊,而不是當它沒有。
任何想法?謝謝。 (代碼,截圖如下&視頻)
- (IBAction)add:(id)sender {
// create the view
AddAttainmentController *addScreen = [[AddAttainmentController alloc] init];
// pass in a selected pupil
[addScreen setPupils:[NSMutableArray arrayWithObject:pupil]];
// add the view to a navigation controller
UINavigationController *control = [[UINavigationController alloc] initWithRootViewController:addScreen];
// place the navigation controller on the screen
[self presentModalViewController:control animated:YES];
// release at the end
[control release];
[addScreen release];
}
截圖:http://cl.ly/032v2k0t0N1s1m3H0511(你可以看到導航欄作爲模態窗口幻燈片)http://cl.ly/1h0o453Y3Z051P3S1S37(模態窗口的導航欄是由原始覆蓋)
視頻:http://cl.ly/1e2J3o1q3V1l1j470m12
感謝您的幫助,我根本沒有意識到這一點,似乎是一個不必要的限制。有關替代方案的任何建議? – 2011-01-13 17:37:44