更改 leftBarButtonItem 的外观
我在导航栏上做了一个高度自定义的按钮,有时是后退按钮,但有时是刷新(以多种方式)按钮。所以我不得不使用 leftBarButtonItem 而不是 backBarButtonItem。当它作为一个“后退按钮”时,有什么好方法让它看起来像一个“后退按钮”?
Possible Duplicate:
Creating a left-arrow button (like UINavigationBar's “back” style) on a UIToolbar
I did a highly customized button on navigation bar, which is a back button sometimes but a refresh (in a variety of ways) button some other times. So I had to go with leftBarButtonItem instead of backBarButtonItem. What's a good way to make it look like a "back button" when it serves as one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当需要作为后退按钮时,您可以使用
backBarButtonItem
。当它变为刷新时,您可以使用 self.navigationItem.hidesBackButton = YES ,然后设置您自己的 leftBarButtonItem 。如果您想要动画,请尝试:
You can use the
backBarButtonItem
when it needs to be a back button. When it changes to a refresh, you can useself.navigationItem.hidesBackButton = YES
and then set your ownleftBarButtonItem
.If you'd like animation, try: