iphone - 如何使用容器 View 导航 Controller 中的按钮返回到上一个 View

标签 iphone ios6 container-view

嗨,我是 iOS 新手

在我的项目中,由于色调效果,我不想使用导航栏,因此我使用容器 View 来创建类似的东西,除了后退按钮,我使用了背面带有按钮的图像。

我使用了容器 View (连接到导航 Controller )来包含一个标签和一个按钮,该按钮顶部有一个图像。我希望当我单击按钮(容器 View 的导航 Controller 内的按钮)时 View 返回到上一个 View 。我尝试了通常的 [self.navigationController popViewControllerAnimated:YES];但没有结果。我该如何执行这个任务?

最佳答案

如果您正在使用

[self presentViewController:yourVC animated:YES completion:nil];

要展示你的 View Controller ,那么你应该使用

[self dismissViewControllerAnimated:YES completion:nil];

关闭当前的 View Controller 并返回到上一个 View Controller 。

关于iphone - 如何使用容器 View 导航 Controller 中的按钮返回到上一个 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18096518/

相关文章:

iphone - 无法在 iOS 上使用非 QWERTY 键盘打字

iOS:在旧 iOS SDK 中使用新 SDK 中的常量

ios - 获取对容器 View 的 View Controller 的引用

ios - 在 iOS 中使用选项卡更改容器 View 内容

ios - 单击一个按钮时如何发送事件

iphone - 在 iPad 中制作网格像素编辑器

iphone - 为新的 iPhone 游戏支持旧版 iOS 值得吗?

ios - 在 iOS 6 中,UIViewController 能否支持比其父级更多的界面方向?

ios - 如何在 iOS 6 中禁用 UITableView 水平滚动?

uiviewcontroller - 如何在界面构建器中创建容器/ subview Controller 关系