ポートレートと風景の両方向をサポートするアプリケーションです。風景モードで表示されたときにUIViewControllerが正しく表示されない
self.modalViewController = [[ModalViewController alloc] init];
[self presentViewController:self.modalViewController animated:YES completion:^{
}];
ModalViewControllerが唯一の風景の中に、ユーザによって見られるべきコントローラです:私は、次のコードを使用してUITabBarControllerに位置のUIViewControllerからモーダルのUIViewControllerを提示しています。それは、LandscapeRightをLandscapeLeftに回転することができるはずです。これは次のようになります。
@implementation ModalViewController
#pragma mark - UIViewController - Orientation
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotate
{
return YES;
}
#pragma mark - NSObject
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor greenColor];
}
#pragma mark - UIViewController - Status Bar
- (BOOL)prefersStatusBarHidden
{
return YES;
}
@end
コントローラーは、左側からスライドし、画面の95%を完全にカバーします。しかし、時間の5%は、それは下からスライドし、画面の上半分のみをカバーします。ここで
は、それがうまく働いているとき、それはどのように見えるかです:
をそしてここでそれがうまく機能していないとき、それはどのように見えるかです:
は私がすることができますサンプルプロジェクトを作成しましたここにあります:https://github.com/TitouanVanBelle/Bug
lpは問題を再現しますが、動作することはめったにありません。
これはなぜ起こっているのですか?
これを投稿していただきありがとうございます。また、解決策を探しています – sage444