ios - 模式演示风格 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];
}
解决方案
推荐阅读
- java - 制作静态数据源
- c - 与 C 中命令行参数的动态内存分配混淆
- wpf - 如何在 WPF 工具栏中更改 ToolBarOverflowPanel 的 WrapWidth 值
- selenium - 调用类导致的空异常
- c# - 如何找到我的文件控制台应用程序的文件路径,找不到文件显示
- hibernate - EntityManagerFactory 类型的不明确依赖项
- java - 我使用Hystrix(1.5.18),并设置参数ErrorThresholdPercentage=30,总是marksuccess时的断路状态切换
- android - 单击 RecyclerView 项目时,有几个项目会起作用
- html - 点击没有任何反应
- c++ - 具有整数溢出的递归斐波那契