我可以在第一响应者 iphone xcode 中使用后退按钮吗?
当我单击 xib 中的第一响应者时,检查器会显示一些内容,例如返回、重新加载以及其他看起来可以连接到 web 视图的输出。
我没有创建其中列出的任何“收到的操作”。
我可以使用“返回”操作并将其连接到按钮以返回吗?或者我必须制作自己的 IBaction 并将其连接到按钮吗?
When I click the first responder in the xib, the inspector shows several things, such as go back, reload, and other outputs that look like they can be connected to the webview.
i didnt create any of the 'received actions' listed there.
can i use the 'goBack' action and connect it to a button to go back? or do i have to make my own IBaction and connect that to the button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信您必须在要放置的视图中为后退按钮创建一个 IBAction。不过,我建议使用 modalTransitionStyle 切换视图。它更容易实现,并且在界面构建器中不会那么混乱。
如果您仍然想使用这个导航概念,后退按钮将是这样的。将左侧带有“项目”按钮的工具栏拖动到所需视图的顶部。将“Item”重命名为“Back”
在您的标头中,您将拥有:
在您的 main 中:
然而,这是当您只有两个视图,并且正在使用我推荐的 modalViewController 时。
本教程应该有所帮助:http:// www.youtube.com/user/antman872?blend=1&ob=5#p/search/0/zzay_bHVBS0
希望有帮助
I believe you would have to create an IBAction for the back button in the view you are placing it in. I do however recommend switching views using the modalTransitionStyle. It is much easier to implement and not as confusing in the Interface builder.
If you still want to use this Navigation concept, the back button would be something like this. Drag in a toolbar with the "Item" button on the left hand side to the top of the view you want. Rename "Item" to "Back"
In your header you would have:
And in your main:
This however is when you have two views only, and are using modalViewController, which I recommend.
This tutorial should help: http://www.youtube.com/user/antman872?blend=1&ob=5#p/search/0/zzay_bHVBS0
Hope that helps
正如您所说,这是针对
UIWebView
的,而不是与UIViewControllers
或UIViews
一起使用。是的,我会创建您自己的IBAction
,将其链接到按钮,然后在 .m 文件中调用dismissModalViewControllerAnimated:BOOL
。That's for a
UIWebView
, as you said, and not for working withUIViewControllers
orUIViews
. Yes, I would create your ownIBAction
, link that to a button, and then in the .m file, calldismissModalViewControllerAnimated:BOOL
.