Iphone UITabBar导航和presentModalViewController
我有一个基于UITabBar的导航,希望在其他寡妇的上面总是有tabbar。在一个控制器中,我有打开另一个控制器的方法,但当我使用这个UITabBar时,它就消失了。 我还应该做些什么Iphone UITabBar导航和presentModalViewController,iphone,ios,uitabbarcontroller,uitabbar,uitabbaritem,Iphone,Ios,Uitabbarcontroller,Uitabbar,Uitabbaritem,我有一个基于UITabBar的导航,希望在其他寡妇的上面总是有tabbar。在一个控制器中,我有打开另一个控制器的方法,但当我使用这个UITabBar时,它就消失了。 我还应该做些什么 ThirdView*third =[[ThirdView alloc] initWithNibName:nil bundle:nil]; third.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self.tabBarController
ThirdView*third =[[ThirdView alloc] initWithNibName:nil bundle:nil];
third.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.tabBarController presentModalViewController:third animated:YES];
[third release];
您应该使用
UINavigationController
s作为UITabBarController
的选项卡。然后,要显示新的UIViewController
,您需要将其推送到UINavigationController
的堆栈上。您可以这样做:
[self.navigationController pushview控制器:您的控制器
动画:是]
如果想要模态效果,可以执行以下操作:
#import <QuartzCore/QuartzCore.h>
CATransition* transition = [CATransition animation]; transition.duration = 0.4f;
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition
forKey:kCATransition]
[self.navigationController pushViewController:v animated:NO];
#导入
CATTransition*转换=[CATTransition动画];过渡时间=0.4f;
transition.type=kCATransitionMoveIn;
transition.subtype=kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:转换
福克斯:KCATRANSION]
[self.navigationController pushViewController:v动画:否];
但我不想使用pushViewController,这很正常。但是如果出现ModalViewController呢?UItabbar仍然不存在模态视图控制器将放置在UItabbar控制器的顶部。UINavigationController更适合您的需要。你也可以这样做