如何将图像设置为 UINavigationController 的后退按钮
我想将图像设置为 UINavigationController 的后退按钮
I want to set an image to the back button of UINavigationController
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用此代码:
或使用此库。非常简单且美观的结果。
https://github.com/boctor/idev-recipes/tree/master/自定义后退按钮
Use this code:
Or use this library. Very easy and good looking result.
https://github.com/boctor/idev-recipes/tree/master/CustomBackButton
您无法更改默认后退按钮,因为它不允许您覆盖它。相反,您必须使用
leftBarButtonItem
创建自定义“后退”按钮。更多信息请参见:
一些之前的代码可供参考: UINavigation 控制器按钮,如 backButton
You cannot change the default back button since it will not let you override it. Instead you have to use the
leftBarButtonItem
to create a custom "back" button.More information here: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UINavigationController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006934-CH3-SW25
Some prior code to reference: UINavigation controller button like backButton
只需在导航控制器上调用 popViewControllerAnimated 即可返回。
Just call
popViewControllerAnimated
on the navigation controller and it will go back.