我正在尝试实现iOS 8中引入的新方法
viewWillTransitionToSize
(所有其他旋转方法均已弃用)。我想知道didRotateFromInterfaceOrientation
现在对应的是什么,因为我们需要执行一些清理任务,而我无法找到可以分配给UIViewControllerTransitionCoordinator
的块,以便在“过渡”到新大小完成时调用它们。谢谢。
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; // 做你想做的事
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { }]; [super viewWillTransitionToSize: size withTransitionCoordinator: coordinator];}` - strange[UIDevice currentDevice].orientation
。你还可以将其输入到UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)
或UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)
中。希望这能帮助到你! - Jeff