我們的iPad版本中存在下一個問題。iPad:UIModalPresentationFormSheet在橫向模式下失敗
我有一個UITabBar內的NavigationController。我想用一種看起來像&感覺與電子郵件形式相似的表單。
我使用相同的代碼,以顯示爲中心的模型:
// View to be displayed in the modal
AdhocViewController *controller = [[AdhocViewController alloc] initWithNibName:@"AdhocViewController" bundle:[NSBundle mainBundle]];
controller.caller = self;
// The form will need a navigation bar to cancel or save the form
UINavigationController *modalViewNavController = [[UINavigationController alloc]
initWithRootViewController:controller];
// Configurate the modal presentation and transition
modalViewNavController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
modalViewNavController.modalPresentationStyle = UIModalPresentationFormSheet;
// Show the new view
[self presentModalViewController:modalViewNavController animated:YES];
此代碼工作完全在縱向模式,但對景觀部分出現在屏幕的看法......我沒找到但解決它的方法。
我測試一些我發現這裏的解決方案......
並嘗試下一行預設的模型視圖來調整它之後添加,但不工作了
controller.view.superview.frame = CGRectMake(0, 0, 600, 700);
controller.view.superview.center = self.view.center;
有什麼建議嗎?
感謝,
伊萬
在StackOverflow的參考文獻:
- iPad modalPresentationStyle UIModalPresentationFormSheet orientation problem
- UIModalPresentationFullScreen not working in iPad landscape mode?
- UIModalPresentationFormSheet on iPad in landscape mode
- How to resize a UIModalPresentationFormSheet?
嘗試這樣的回答:http://stackoverflow.com/questions/4272718/modal-view-using-uimodalpresentationformsheet-appears-offscreen/4273720#4273720 – Anna
我會盡力...的時刻,我修復了肖像模式 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 回報(UIInterfaceOrientationIsPortrait(toInterfaceOrientation)); } –
Karenina,我已經找到它並檢查它..但不成功...你能分享你準確的代碼嗎? 謝謝 –