gpt4 book ai didi

ios - 如何在不隐藏 TabBar 的情况下呈现具有自下而上动画的 UIViewController

转载 作者:行者123 更新时间:2023-11-28 18:43:20 25 4
gpt4 key购买 nike

所以,我有一个 UITabbarController,里面有一个 UINavigationController。在按下按钮时,我想引入另一个 UINavigationController,像使用 presentModalViewController:animated: 一样对其进行动画处理,但我不希望它隐藏 TabBar .

UIKit(3.1.3 及更高版本)中是否有任何我可以用于此目的的东西,或者我必须自己制作动画吗?

最佳答案

只需测试代码,如果您需要像 pushViewController:animated: 这样的操作,也许您需要将 navigationController 设置为 property

UIViewController * aViewController = [[UIViewController alloc] init];
[aViewController.view setFrame:self.view.frame];
[aViewController.view setBackgroundColor:[UIColor redColor]];

UINavigationController * navigationController = [[UINavigationController alloc] initWithRootViewController:aViewController];
[aViewController release];
[navigationController.view setFrame:CGRectMake(0.0f, 480.0f, 320.0f, 480.0f)];
[self.navigationController.view addSubview:navigationController.view];

[UIView animateWithDuration:0.3f
delay:0.0f
options:UIViewAnimationOptionCurveLinear
animations:^{
[navigationController.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
}
completion:nil];
[navigationController release];

关于ios - 如何在不隐藏 TabBar 的情况下呈现具有自下而上动画的 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8536053/

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