iOS 8 旋转方法弃用 - 向后兼容性 [英] iOS 8 Rotation Methods Deprecation - Backwards Compatibility

查看:20
本文介绍了iOS 8 旋转方法弃用 - 向后兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 iOS 8 中,界面旋转的方法是 已弃用.这包括:

In iOS 8, the methods for interface rotation are deprecated. This includes:

  • willRotateToInterfaceOrientation:duration:
  • didRotateFromInterfaceOrientation:
  • willAnimateRotationToInterfaceOrientation:duration:

替换方法包括:

  • willTransitionToTraitCollection:withTransitionCoordinator:
  • viewWillTransitionToSize:withTransitionCoordinator:

如果未实现新的旋转方法,并且项目是使用 iOS 8 SDK 编译的,则视图控制器 - 将不会接收调用- 对已弃用的旋转方法的调用.

If the new rotation methods are not implemented, and a project is compiled with the iOS 8 SDK, the view controllers -will not receive calls- to the deprecated rotation methods.

我担心的是:AppStore 中已经使用 iOS 7 SDK 构建的应用会发生什么情况?是否仍会在 iOS 8 设备上调用已弃用的轮换方法?

仍会调用旋转方法,但在 iOS 8 中存在一些更改/问题/错误.

The rotation methods are still called, but there exist some changes/issues/bugs in iOS 8.

另外,UIScreen 现在是面向界面的

Also UIScreen is now interface oriented

推荐答案

iOS 8 SDK 中不推荐使用旋转方法.这对使用 iOS 7 SDK 构建的应用完全没有影响,即使在 iOS 8 和未来的几个 iOS 版本中运行也是如此.

The rotation methods are deprecated in the iOS 8 SDK. This will have no effect at all on apps built with the iOS 7 SDK, even running in iOS 8 and probably several future versions of iOS.

例如,UIButtonfont 属性自 iOS 3.0 以来已被弃用,但在 iOS 7.0 中仍然可用.

As an example, the font property of UIButton has been deprecated since iOS 3.0 and is still available in iOS 7.0.

这篇关于iOS 8 旋转方法弃用 - 向后兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆