gpt4 book ai didi

iphone - iPhone 应用程序的单阶段动画还是两阶段动画?

转载 作者:太空狗 更新时间:2023-10-30 03:16:34 25 4
gpt4 key购买 nike

旋转 iPhone 窗口的单态和两级动画是什么?

这是我在调试器控制台中收到的“错误”消息(没有崩溃):

Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.

我正在阅读 Apress(Dave Mark、Jeff LaMarche)在 Swap 项目上撰写的“开始 iPhone 开发:探索 iPhone SDK”一书。

最佳答案

所有内容都在 UIViewController Class Reference 中进行了解释.尤其要查看顶部附近的 View 旋转部分。

来自引用:

Handling View Rotations

By default, the UIViewController class displays views in portrait mode only. To support additional orientations, you must override the shouldAutorotateToInterfaceOrientation: method and return YES for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController class provides additional hooks for you to implement additional behaviors as needed.

To temporarily turn off features that are not needed or might otherwise cause problems during the orientation change, you can override the willRotateToInterfaceOrientation:duration: method and perform the needed actions there. You can then override the didRotateFromInterfaceOrientation: method and use it to reenable those features once the orientation change is complete.

If you want to perform custom animations during an orientation change, you can do so in one of two ways. Orientation changes used to occur in two steps, with notifications occurring at the beginning, middle, and end points of the rotation. However, in iPhone OS 3.0, support was added for performing orientation changes in one step. Using a one-step orientation change tends to be faster than the older two-step process and is generally recommended for any new code.

To add animations for a one-step orientation change, override the willAnimateRotationToInterfaceOrientation:duration: method and perform your animations there. To use the older two-step method, override one or both of the willAnimateFirstHalfOfRotationToInterfaceOrientation:duration: and willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration: methods to configure your animations before each step. You must choose only one technique and override just the methods associated with that technique. If you override either method associated with the two-step technique, the view controller uses that technique by default.

关于iphone - iPhone 应用程序的单阶段动画还是两阶段动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2048781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com