我们的应用有一个 UINavigationBar,上面有一张图片.当我们继续(推送)到另一个屏幕然后单击后退按钮时,导航栏上的图像似乎在重新出现时从左到右进行动画处理.这有点让人分心.你怎么能删除这个后退按钮动画?
我们尝试更改 segue 动画设置,但这会更改推送动画而不是返回动画.
我们的导航条码:
让 logoImage:UIImage = UIImage(named: "ABC")!viewController.navigationItem.titleView = UIImageView(图片: logoImage)
很大程度上是由于这个答案
请注意,我没有像链接的答案那样覆盖 NavigationController popViewControllerAnimated
.
Our app has an UINavigationBar with an image on it. When we segue (push) to another screen then click the back button the image on the Navigation Bar seems to animate from left to right as it reappears. This is a little distracting. How can you remove this back button animation?
We tried changing the segue Animates setting but this changes both the push animation and not the back animation.
Our Nav Bar code:
let logoImage:UIImage = UIImage(named: "ABC")!
viewController.navigationItem.titleView = UIImageView(image: logoImage)
Figured this out in large part due to this answer https://stackoverflow.com/a/8602982/47281
Create a custom Nav Bar and override popItem
:
class MyNavigationBar: UINavigationBar {
override func popItem(animated: Bool) -> UINavigationItem? {
return super.popItem(animated: false)
}
}
Entered MyNavigationBar
as the Navigation Bar class for our Navigation Controller via the Storyboard:
Note I did not override NavigationController popViewControllerAnimated
as in the linked answer.
这篇关于iOS:删除 UINavigationBar 动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!