【发布时间】:2016-09-26 14:52:01
【问题描述】:
当我旋转设备时,我正在使用 viewWillTransitionToSize 来调整我的滑出菜单,但是它似乎在 Swift 3 中被破坏了?谁能帮我解决这个问题?我的代码如下所示:
func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
coordinator.animate(alongsideTransition: nil, completion: {
_ in
let controller = self.revealViewController().rightViewController
var frame = controller?.view.frame
frame?.size.height = UIScreen.main.bounds.size.height - self.navigationController!.navigationBar.frame.size.height - self.toolBar.frame.size.height - (UIApplication.shared.isStatusBarHidden ? 0 : 20)
controller?.view.frame = frame!
})
}
旋转设备时好像没有调用它?
【问题讨论】: