ios - 我如何在导航 Controller 中从下到上呈现/关闭 View Controller ?

标签 ios objective-c uinavigationcontroller show-hide presentviewcontroller

当我将viewController推送到navigationController时,我想从下到上显示动画?有人知道吗?

RegisterViewController *registerView = (RegisterViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"RegisterViewController"];

现在

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

关闭

[self dismissViewControllerAnimated:YES completion:nil];

有什么方法可以在navigationController中实现这一点吗?

最佳答案

不要链接 Storyboard

Present ViewController with this code

它将从下到上呈现

UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MYUnicornViewController"]; // Change the view controller name
[self.navigationController presentViewController:vc animated:YES completion:nil];

Dismiss ViewController with this code

它将从上到下关闭

[self.navigationController dismissViewControllerAnimated:YES completion:nil];

enter image description here

关于ios - 我如何在导航 Controller 中从下到上呈现/关闭 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38697989/

相关文章:

ios - 为什么在安装应用程序时启动 Paper-Onboarding 时导航 Controller 消失?

ios - 让 ViewControllers 访问 NavigationController 的好方法?

ios - 苹果测试八哥游戏证书

ios - Xcode tableview 图像一次又一次加载

ios - 与我的应用关联的文件类型

objective-c - 有什么理由不返回一个不期望的可变对象吗?

ios - UICollectionView IOS 中 header 的操作

ios - 关于ScrollView与PageControl的几个问题

ios - 如果需要,如何重新创建主 Storyboard

objective-c - iPhone : access constant values