iOS 7 在 UINavigationController 中呈现模态视图?

标签 ios iphone objective-c uinavigationcontroller

我的应用程序是使用 UINavigationController 设置的,用于所有导航。我想使用模态转换在应用程序中呈现特定的 View Controller 。问题是我想将新的 VC 嵌入导航 Controller 中,但只是一个 View 需要使用模态动画而不是推送。

如何在 UINavigationController 内的单个 View Controller 上实现此模态动画/过渡?

请记住,在此模态动画发生后,该页面上的按钮将继续按照标准 UINavigationController 推送动画工作。

最佳答案

ITviewViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"vc"];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:Nil];

用您的 View Controller 名称替换伪代码。

关于iOS 7 在 UINavigationController 中呈现模态视图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20133761/

相关文章:

ios - 如何在 Xcode Storyboard中定位警告?

ios - 如何以编程方式从 UIView 获取约束 "bottomSpace"?

iphone - 在视网膜和非视网膜屏幕上使用图像作为文本

ios - 传播特定的触摸事件以在下方查看

ios - 无法打开下一个 ViewController - *** 断言失败 - [UIKeyboardTaskQueue waitUntilAllTask​​sAreFinished]

iphone - 在 iPhone 上使用 Apache Thrift 是否成功?

iphone - 无法将数据从 Data sqlite 预加载到我的核心数据

objective-c - GCD 和 RunLoop

ios - 单元格标签在表格滚动之前不会调整大小

objective-c - NSLocalizedString,根据应用程序首选项更改语言