我有一個UISplitViewController
設置在我的應用程序的rootView。當viewDidLoad
叫我左視圖控制器我做了檢查,然後使用提出一個模式視圖控制器以下:從UISplitViewController提供的modalViewController出現錯誤的方向
SiteConfiguration *config = [[SiteConfiguration alloc] initWithStyle:UITableViewStyleGrouped];
config.firstLoad = YES;
UINavigationController *configNav = [[UINavigationController alloc] initWithRootViewController:config];
if ([Utility isIpad]) {
configNav.modalPresentationStyle = UIModalPresentationFormSheet;
configNav.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[[AppDelegate instance].splitViewController presentModalViewController:configNav animated:YES];
} else {
[self presentModalViewController:configNav animated:YES];
}
如果iPad在橫向模式下,同時應用程序加載時,modalView顯示有不正確定位:
我可以旋轉iPad來解決這個問題,但爲什麼它加載錯了嗎?我的shouldAutorotateToInterfaceOrientation:
在我的SiteConfiguration
viewController中返回YES。什麼可能導致這個?
我不得不把它放在'viewDidAppear:'中,並且做到了! – 2012-07-19 20:42:09
哎呀,我打算輸入'viewDidAppear:'。我已經適當地編輯了我的答案 – 2012-07-19 20:44:33