首页 > 解决方案 > 模式演示风格 iOS 13 上的横向应用程序

问题描述

对于模式演示样式视图控制器,iOS 13 对横向横向有任何限制吗?对于全屏演示风格的作品,但在模态冻结和崩溃。

在此处输入图像描述 应用委托:

 - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    if (self.shouldRotate) {
        return UIInterfaceOrientationMaskAll;
    } else {
        return UIInterfaceOrientationMaskPortrait;
    }

功能:

-(void) restrictRotation:(BOOL) restriction {
    AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
    appDelegate.shouldRotate = restriction;
}

视图将出现

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self restrictRotation:YES];
}

标签: iosobjective-cuimodalpresentationstyle

解决方案


推荐阅读