iOS: Removing UINavigationBar animation(iOS:删除 UINavigationBar 动画)
问题描述
我们的应用有一个 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 动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS:删除 UINavigationBar 动画


- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- URL编码Swift iOS 2022-01-01
- UITextView 内容插图 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- GPS状态的广播接收器? 2022-01-01