Ich füge Uiimageview als Unteransicht zu tabbarcontroller.view hinzu. Wenn ich auf andere Ansicht schob Controller Tabbarcontroller wird versteckt, aber das Bild erscheint beim Drücken auf andere Klasse. Innerhalb der Tableiste Controller ist das gesamte Tabbar-Element ein Navigationscontroller. Ich habe nicht Tabbar im Inneren des TabBarController hinzufügen Hier ist mein Code:Ausblenden von uiimage, wenn zu anderem View-Controller geschoben
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];
[email protected]"TrackProgram";
tabItem1.view.backgroundColor=[UIColor clearColor];
TrackClinic_iPhone *loc = [[TrackClinic_iPhone alloc] init];
UINavigationController *tabItem2 = [[[UINavigationController alloc] initWithRootViewController:loc] autorelease];
[email protected]"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];
wenn ich Pushed andere Klasse
-(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];
}
Doppelpfosten von [Hiding Imageview] (http://stackoverflow.com/questions/9989224/hiding-imageview) – jrturton