UINavigationController 上视图之间的过渡动画有多长?
理想情况下,应该有某种包含该值的常量。
我正在实现具有自己的过渡动画的代码,并且我希望这些代码具有与平台过渡动画相同的长度。
Ideally, there would be some kind of constant containing this value.
I'm implementing code that has it's own transition animations, and I'd like those to have the same length as the platform transition animations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 iOS 7 及更高版本中,您可以通过设置
UINavigationController
委托并使用以下方法获得准确的值:如果默认持续时间发生变化,这是面向未来的方法。目前它的值为 0.35 秒。
In iOS 7 and later you can have exact value by setting the
UINavigationController
delegate and using the method:This is future proof method if the defult duration will ever change. At the moment it's value is 0.35 second.
没有包含该值的常量。但是,使用以下 UINavigationControllerDelegate 方法:
... 我可以看到持续时间约为 0.35 秒
有趣的是,视图的不同部分需要不同的时间才能过渡到位。有关更多详细信息,请参阅这篇精彩的博客文章:
http:// www.iclarified.com/12396/a-closer-look-at-iphone-transition-animations
There's no constant containing this value. However, using the following
UINavigationControllerDelegate
methods:... I can see that the duration is approx 0.35 seconds
Interestingly, different parts of the views take different times to transition into place. See this great blog post for more details:
http://www.iclarified.com/12396/a-closer-look-at-iphone-transition-animations