问题描述
我正在使用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).
以下是相关文档:
这篇关于在iOS 5上使用Segues / Storyboard弹出当前视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!