所以,我有一个UITabbarController
与UINavigationController
在它。按下按钮后,我想引入另一个UINavigationController
,像使用presentModalViewController:animated:
时一样使其动画,但我不希望它隐藏标签栏。
有什么在UIKit(3.1.3及以后),我可以使用这个或我将不得不做动画自己吗?
只是测试代码,也许你需要设置navigationController
为property
,如果你需要做pushViewController:animated:
。
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];
默认情况下,从下向上呈现内容的唯一方法是presentModalViewController。你实际上可以覆盖你的navigationController的动画,但这不是你可以通过调用一个不同的方法来实现的,你必须创建你自己的,并处理动画。