如何恢复 UINavigationController 中的后退按钮功能?
我创建了自己的 leftBarButtonItem:
UIBarButtonItem* homeButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks
target:self
action:@selector(homeButtonClicked:)];
self.navigationItem.leftBarButtonItem = homeButton;
如何以编程方式恢复原始后退按钮功能?
I have created my own leftBarButtonItem:
UIBarButtonItem* homeButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks
target:self
action:@selector(homeButtonClicked:)];
self.navigationItem.leftBarButtonItem = homeButton;
How can I restore the original back button functionality programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这将删除您的自定义左按钮,后退按钮将再次出现。
This will remove your custom left button, and the back button will appear again.
后退按钮将调用
UINavigationController
的popViewController
,因此您可以在homeButtonClicked:
选择器上复制它。The back button will call
UINavigationController
'spopViewController
, so you can replicate that on yourhomeButtonClicked:
selector.