i have added tab bar in app delegate. When i pushed the view from one of my view te tab bar got removed. I want that tab bar on pushed view also.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
AudioViewController * audioViewController = [[AudioViewController alloc] initWithNibName:@"AudioViewController" bundle:nil];
audioViewController.title = @"audio";
audioViewController.tabBarItem.image=[UIImage imageNamed:@"audio 30x30.png"];
ViewController *videoViewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
videoViewController.title = @"video";
videoViewController.tabBarItem.image=[UIImage imageNamed:@"video 30x30.png"];
ViewController *aboutViewController = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
aboutViewController.title = @"about";
aboutViewController.tabBarItem.image=[UIImage imageNamed:@"about1_iPhone.png"];
ViewController *infoViewController = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
infoViewController.title = @"info";
infoViewController.tabBarItem.image=[UIImage imageNamed:@"info 30x30.png"];
PlaylistViewController *PlaylistViewControllerObj = [[PlaylistViewController alloc]initWithNibName:@"PlaylistViewController" bundle:nil];
PlaylistViewControllerObj.title = @"Playlist";
PlaylistViewControllerObj.tabBarItem.image=[UIImage imageNamed:@"ko.png"];
NSArray *viewControllerArray = [NSArray arrayWithObjects:audioViewController,videoViewController,aboutViewController,infoViewController,PlaylistViewControllerObj,nil];
UITabBarController * myTabbarController = [[UITabBarController alloc] init];
[myTabbarController setViewControllers:viewControllerArray];
navigationControllerObj = [[UINavigationController alloc] initWithRootViewController:myTabbarController];
[navigationControllerObj setNavigationBarHidden:YES animated:NO];
self.window.rootViewController =navigationControllerObj;
}
Check value of this property in the
UIViewController
you are pushingTry this sample code
Use This Code
call this method , where to present UITabBar
In .h,
@property (strong, nonatomic) UINavigationController *navigation; @property(nonatomic, strong) UITabBarController *tabbarcontroller;
In .m,
-(void)loadtabview {
}
UIViewController *viewController1, *viewController2, *viewController3 , *viewController4 , *viewController5 ;