我正在构建一个无法在幻灯片放映或拆分视图中显示的应用。所以,我在info.plist中添加了新密钥“UIRequiresFullScreen”。
它工作正常,但当我尝试在UIScreen.mainScreen().bounds
方法中访问viewWillTransitionToSize
时出现了一些奇怪的事情:
UIRequiresFullScreen => NO
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
print(UIScreen.mainScreen().bounds)
// iPad Pro Simulator, transitioning between Portrait to Landscape
// prints: (0.0, 0.0, 1366.0, 1024.0)
}
UIRequiresFullScreen =>是
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
print(UIScreen.mainScreen().bounds)
// iPad Pro Simulator, transitioning between Portrait to Landscape
// prints: (0.0, 0.0, 1024.0, 1366.0)
}
发生了什么事?
OBS:我正在使用iOS 9 SDK,支持所有方向,使用Size Class和发布故事板,所以我最后的希望是这个UIRequiresFullScreen
密钥。