- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图以编程方式强制一个弹出 View 为横向,同时我在项目设置中将应用程序的设备方向设置为纵向。我的代码如下所示:
override func shouldAutorotate() -> Bool {
return true
}
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return UIInterfaceOrientation.LandscapeLeft
}
这没有用,所以我尝试添加:
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.All
}
但是还是没有轮换。为什么会发生这种情况?
最佳答案
只有在 View Controller 是根 View Controller 或全屏显示 View Controller 时, View Controller 才有发言权。您的 View Controller (弹出窗口)都不是;因此它在轮换中没有发言权。
关于ios - preferredInterfaceOrientationForPresentation 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35109052/
我只是创建了一个新的单 View 应用程序,并在 ViewController.m 文件中编写了三个函数。 -(BOOL)shouldAutorotate { return YES; } -(
我有一个场景,其中我有一个带有 5 个选项卡的 UITabbarController。每个选项卡都包含一个 UINavigationController。 现在在 UINavigationContro
我试图以编程方式强制一个弹出 View 为横向,同时我在项目设置中将应用程序的设备方向设置为纵向。我的代码如下所示: override func shouldAutorotate() -> Bool
我正在使用 iOS 8 的 UIPresentationController 编写自定义模式演示文稿。呈现的 Controller 具有首选界面方向 UIInterfaceOrientationLan
此错误没有意义,因为首选方向 UIInterfaceOrientationLandscapeRight 由支持的方向返回 //iOS6 -(BOOL)shouldAutorotate { re
我的应用程序窗口的 Root View Controller 是 UINavigationController 的子类。我已将此代码添加到类(class)中: - (BOOL)shouldAutoro
我们正在经历this crash来自 GoogleSignIn iOS 框架 v4.0.1(通过 CocoaPods 链接)。 致命异常:UIApplicationInvalidInterfaceOr
我正在使用 MSNavigationPaneViewController from here并进行轮换工作。我已经覆盖了根 UINavigationController 中的旋转方法 -(BOOL)s
我在尝试阻止某些 View 中的方向时遇到问题,但代码不起作用。 我在每个 View 中都使用这条线: - (BOOL)shouldAutorotate { return YES; } - (
我是一名优秀的程序员,十分优秀!