我试图在转动设备屏幕时创建一个 Action 。
在苹果documentation我读到你必须使用这种方法:
override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
println("I rotate.")
self.tabBar.frame = CGRectMake(0, 80, self.view.bounds.size.width, self.view.bounds.size.height);
}
但是当我在日志中转动屏幕时不会打印“I rotate”。
编辑:
这些是项目的设置:
最佳答案
关于ios - 在 iOS 中旋转屏幕时如何执行某些操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28369824/