ios - 在 iOS 中旋转屏幕时如何执行某些操作?

标签 ios swift rotation

我试图在转动设备屏幕时创建一个 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”。

编辑:

这些是项目的设置: enter image description here

最佳答案

willRotateToInterfaceOrientation 函数在 iOS 8 中已弃用,您可以在 Apple 文档中看到 here 。请参阅讨论here在 StackOverflow 上。

关于ios - 在 iOS 中旋转屏幕时如何执行某些操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28369824/

相关文章:

ios - UICollectionView reloadData 索引超出范围

android - 如何将使用 ADFS 身份验证的响应式 Web 应用程序封装到仅使用 bluemix 服务的 native iOS/Android 应用程序中?

ios - 将 RLMResults 转换为 RLMArray

ios - 来自 Regex 的 Swift 3 提取组 - NS 桥接困惑

javascript - 逐渐旋转一个物体以面对一个点?

iphone - 推送通知无法在一个ipod中工作,其余的设备iphone-4,iphone-3,ipod都可以正常工作

ios - 录制视频时的音量

swift - 完美,快速,从处理程序中的请求获取服务器地址

c++ - D3DXMatrixTransformation2D 行为怪异

python - python 中带有箭头的简单 2d 表面?