在iOS 5上使用Segues / Storyboard弹出当前视图 [英] Pop the current view using Segues/Storyboard on iOS 5

查看:120
本文介绍了在iOS 5上使用Segues / Storyboard弹出当前视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS 5 SDK创建应用。我设法使用Storyboard的Segues推送视图,但我找不到正确的方法来弹出当前视图并返回到前一个视图。

I am creating an app using iOS 5 SDK. I managed to push views using the Storyboard's Segues, but I cannot find the proper way to pop the current view and go back to the previous one.

我没有使用任何视图navigationController(该应用程序没有任何顶部或底部栏)。

I am not using any navigationController (the app doesn't have any top or bottom bars).

我不认为使用modal或push segue将是另一种解决方案,因为它实例化一个新的控制器。

I don't think using modal or push segue the other way would be the solution as it instantiates a new controller.

我是否必须使用相反动画的自定义Segue并在结尾删除视图?或者有更好的方法吗?

Do I have to use a custom Segue with the opposite animation and deletion of the view at the end ? Or is there a better way ?

推荐答案

您可以尝试调用 [self dismissViewControllerAnimated:YES completion:nil ]; 来自您想要解除的控制器(控制器是否已按下或以模态显示)。

You could try calling [self dismissViewControllerAnimated:YES completion:nil]; from the controller you want to dismiss (whether the controller has been pushed, or shown modally).

以下是相关文档: UIViewController类参考


呈现视图控制器负责解除它所呈现的视图控制器。如果您在呈现的视图控制器本身上调用此方法,它会自动将消息转发给呈现视图控制器。

The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, it automatically forwards the message to the presenting view controller.

这篇关于在iOS 5上使用Segues / Storyboard弹出当前视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆