I am adding Uiimageview as a subview to tabbarcontroller.view. when i pushed to other view controller tabbarcontroller gets hided but the image is appearing while pushing to other class.Inside the tabbarcontroller all the tabbar item is a navigation controller. I didnt add tabbar inside the tabbarcontroller
Here is my code:
imgV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 428, 320, 48)];
tabBarController = [[UITabBarController alloc] init];
tabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
tabBarController.moreNavigationController.topViewController.view.backgroundColor=[UIColor clearColor];
tabBarController.delegate=self;
// tabBarController.selectedIndex=0;
UIImage *img = [UIImage imageNamed: @"home_selected.png"];
[imgV setImage:img];
// [imgV setAlpha:0.5];
[self.tabBarController.view addSubview:imgV];
[self.tabBarController.view bringSubviewToFront:imgV];
[imgV release];
Dashboard_iPhone *dash = [[Dashboard_iPhone alloc] init];
UINavigationController *tabItem0 = [[[UINavigationController alloc] initWithRootViewController:dash] autorelease];
tabItem0.view.backgroundColor=[UIColor clearColor];
TrackProgram_iPhone *rep = [[TrackProgram_iPhone alloc] init];
UINavigationController *tabItem1 = [[[UINavigationController alloc] initWithRootViewController:rep] autorelease];
tabBarController.tabBarItem.title=@"TrackProgram";
tabItem1.view.backgroundColor=[UIColor clearColor];
TrackClinic_iPhone *loc = [[TrackClinic_iPhone alloc] init];
UINavigationController *tabItem2 = [[[UINavigationController alloc] initWithRootViewController:loc] autorelease];
tabBarController.tabBarItem.title=@"TrackClinic ";
tabItem2.view.backgroundColor=[UIColor clearColor];
tabBarController.viewControllers=[NSArray arrayWithObjects:tabItem0,tabItem1,tabItem2,nil];
[self.view insertSubview:tabBarController.view belowSubview:dash.view ];
[self presentModalViewController:tabBarController animated:NO];
when i Pushed to other class
-(void)logoutBtnTap
{
appDelegate.enterLogout=YES;
for(UIImageView *view in[self.view subviews])
{
for(UIImage *img in view.subviews){//remove photoes from the subview
[img removeFromSuperview];
}
[view removeFromSuperview];
}
Login_iPhone *controller=[[Login_iPhone alloc]init];
[controller setHidesBottomBarWhenPushed:YES];
[acctExec_iPhone.imgV removeFromSuperview];
acctExec_iPhone.imgV.hidden=YES;
[self.navigationController pushViewController:controller animated:YES];
[controller release];
}
I comment your older question.
Hiding Imageview
beacuse hidesBottomBarWhenPushed=yes is mean your tabBarController hide tabbar not view.
Be a point of caution, you will need to add to imageView in tabBar not view.
maybe this method send to message tabBarController.tabBar subviews, when a operate push or pop object controller.
so, your imgV add to tabbar. here for example.
but carefully tabBarController.tabBar height-size different tabBarController.view
so, you frame should set size or coordinates.