禁用segue动画 [英] Disabling segue animation
问题描述
我想在我的故事板中显示(例如推送)segues,以连接我的viewcontrollers和我的导航控制器。然后,viewcontrollers上的导航栏将正确显示。
例如:使用show detail或present modaly,导航栏将消失
I want to Show (e.g. push) segues in my storyboard, to connect my viewcontrollers and my navigation controller. Then the navigation bars on the viewcontrollers will show correctly. For example: With show detail or present modaly, the navigation bar will disappear
但我不想要segue动画。
Xcode发出如下警告:在iOS 9.0之前禁用segue动画
But I don't want segue animation. Xcode is giving the warning like : "Disabling segue animation is not available prior to iOS 9.0"
我想要iOS 7.0或8.0的部署目标
And I wants deployment target of iOS 7.0 or 8.0
如何解决这个问题?
提前致谢。
推荐答案
您可以在执行segue之前和再次启用之后禁用动画。
You can disable animations before performing the segue and after enable it again.
UIView.setAnimationsEnabled(false)
self.performSegueWithIdentifier("next", sender: nil)
UIView.setAnimationsEnabled(true)
这将执行没有动画的segue。
This will perform the segue without the animation.
这篇关于禁用segue动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!