1

I have UITabBar based navigation and want always tabbar on top other widows. In one controller i have method which opens other controller, but when i use this UITabBar disappear. What i should do more ?

ThirdView*third =[[ThirdView alloc] initWithNibName:nil bundle:nil];
third.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.tabBarController presentModalViewController:third animated:YES];
[third release];
Streetboy
  • 4,351
  • 12
  • 56
  • 101

1 Answers1

3

You should use UINavigationControllers for the tabs of your UITabBarController. Then to present a new UIViewController you want to push new it onto the stack of your UINavigationController. You can do this like so:

[self.navigationController pushViewController:yourController animated:YES];

If you want the modal effect, you could do something like this:

#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];
Michael Frederick
  • 16,664
  • 3
  • 43
  • 58
  • But i don't want to use pushViewController, this works normal. but what if presentModalViewController ? UItabbar still disappear – Streetboy Jan 04 '12 at 10:12
  • A modal view controller would be intended to lay on top of the UITabBarController. A UINavigationController would be more suitable for your needs. You could also do something like this – Michael Frederick Jan 04 '12 at 19:27