ios - 强制用户将屏幕旋转为横向(iOS)

标签 ios iphone swift user-interface ios10

我正在尝试开发视频播放器应用程序。其中,当用户点击视频时,它将开始以横向模式播放。在我强制用户旋转屏幕的情况下。这是否违反 iOS UI 指南。因此,我将在应用审查中遇到任何问题。请指导我。

最佳答案

swift 3.0

在 viewDidLoad() 中添加:

 let value =  UIInterfaceOrientation.landscapeLeft.rawValue
 UIDevice.current.setValue(value, forKey: "orientation")

还有,

override func shouldAutorotate() -> Bool {
    return true
}

关于ios - 强制用户将屏幕旋转为横向(iOS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44253504/

相关文章:

ios - 在 api 调用 Swift 上显示事件指示器

ios - 创建移动的新按钮时按钮停止移动

ios - iOS 4.2 中的 NSUserDefault 问题

ios - 快速处理 SWRevealViewController 中的 CellForRowAtIndexPath?

iphone - iOS 上的重复推送通知

iphone - 如何更改 iphone CATiledLayer fadeDuration?

ios - GenerationAssetSymbols 中的 Xcode 15 beta 错误

ios - 选择指示器未显示在操作表内的选择器 View 中

ios - UIView animateWithDuration 太快了

iphone - 使用 setAutoresizingMask 定位 UIImageView