gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 05:11:17 25 4
gpt4 key购买 nike

当我将 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com