2012-04-03 3 views
0

ubufviewer.view에 하위보기로 uiimageview를 추가하고 있습니다. 다른 viewcontroller tabbar에 밀어 넣었을 때 tabbarcontroller에 추가 된 이미지가 표시되지 않습니다. 다른 viewcontroller로 이동하면서 imageview를 제거하는 것을 도와주세요.숨기기 이미지보기

 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; 기타의 ViewController

-(void)logoutBtnTap 
    { 
appDelegate.enterLogout=YES; 
for(UIImageView *view in[self.view subviews]) 

{ 
    [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]; 

}에 밀어 넣을 때

UIImage *img = [UIImage imageNamed: @"home_selected.png"]; 
[imgV setImage:img]; 
// [imgV setAlpha:0.5]; 

[self.tabBarController.view addSubview:imgV]; 
[self.tabBarController.view bringSubviewToFront:imgV]; 

hidesBottomBarWhenPushed=yes beacuse

답변

0

은 tabBarController 숨기기 TabBar의가 볼 수 없습니다 의미입니다.

주의해야 할 점은 tabBar보기에서 imageView에 추가해야한다는 것입니다.

어쩌면이 메서드는 메시지 pushButtonController.tabBar 서브 뷰를 보낼 때 작동 푸시 또는 팝 객체 컨트롤러입니다.

이렇게하면 imgV가 탭바에 추가됩니다. 여기 예를 들어.

UIImage *img = [UIImage imageNamed: @"home_selected.png"]; 
[imgV setImage:img]; 

[self.tabBarController.tabBar addSubview:imgV]; 
[self.tabBarController.tabBar bringSubviewToFront:imgV]; 

하지만 신중하게 tabBarController.tabBar 높이 크기

그래서, 당신은 크기 또는 좌표를 설정해야합니다 프레임 다른 tabBarController.view.

1
for(UIImageView *view in[self.view subviews]) 

{ 
    for(UIImage *img in view.subviews){//remove photoes from the subview 
    [img removeFromSuperview]; 
} 
    [view removeFromSuperview];//remove uiimageview from the main view 

}