Xcode iPhone 后退按钮
看起来这很简单,但我找不到任何好的信息。
我只是希望能够“强制”显示后退按钮。我有一个主视图,当我转移到另一个视图时没有后退按钮。但是,如果我转移到第三个视图,则会出现后退按钮。情况似乎总是如此。只有第二个转移到视图显示后退按钮。我需要它显示在除主视图之外的所有视图上。
我不需要覆盖它,只需强制它显示它没有显示的地方......
Seems like this would be a simple thing, but I cannot find any good info on it.
I just want to be able to 'force' the back button to show. I have a main view and when I transfer to another view there is no back button. But then if I transfer to a 3rd view, the back button appears. This seems to always be the case. Only the 2nd transferred to view shows a back button. I need it to show up on all views except the main view.
I dont need to override it, just simply force it to show where it is not showing...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个老问题,但这可能会有所帮助......
有时您需要在导航控制器中嵌入一个视图以显示后退按钮。只需选择您的视图控制器并选择编辑器 ->嵌入 ->导航控制器。
如果按钮没有显示(通常如果您呈现的是模态视图而不是推送),那么您将需要手动创建“取消”按钮。为此创建一个操作并在 put 方法中(我将其称为我的方法 switchback):
I know this is an old question, but this might help...
...sometimes you need to embed a view inside a Navigation Controller for the back button to show. Simply select your view controller and select Editor -> Embed In -> Navigation Controller.
If the button does not show (usually if you are presenting a modal view rather than push) then you will need to manually make a 'Cancel' button. Create an action for this and in the method put (I call my method switchback):
不幸的是,补丁的解决方案(dismissModalViewController)已被弃用并被dismissViewControllerAnimated取代。
这是当前的:
Patch's solution (dismissModalViewController)had been unfortunately deprecated and replaced by dismissViewControllerAnimated.
Here is the current one: