0

UITabBarController에서 UINavigationController가 있는데 숨길 수있는 pushController의 tabBar를 가져올 수 없습니다. 이 밀어 도착하기 전에UITabBar 숨기기

:

tpsv.hidesBottomBarWhenPushed = YES; tpsv.tabBarController.hidesBottomBarWhenPushed = YES;

viewWillAppear :

self.tabBarController.tabBar.hidden = YES;

AppDelegate *del = (AppDelegate *)[[UIApplication sharedApplication] delegate];

를 내가 그것을 숨기려면 다음 코드를 사용하고

[[[del tabController] tabBar]setHidden:YES];

그러나 위 작업 중 어느 것도 수행 할 수 없습니다.

이 문제를 해결하는 방법을 알려 주시면 정말 좋을 것입니다.

MyViewController *myVC = [[[MyViewController alloc] init] autorelease]; 
myVC.hidesBottomBarWhenPushed = YES; 
[self.navigationController pushViewController:myVC animated:YES]; 

[편집 : 코멘트를 다시 사용]

그냥 눈치 당신이 시도라고 새 뷰 컨트롤러를 밀어 넣기 전에

답변

2
- (void) hideTabBar:(UITabBarController *) tabbarcontroller { 


    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:0.5]; 
    for(UIView *view in tabbarcontroller.view.subviews) 
    { 
     if([view isKindOfClass:[UITabBar class]]) 
     { 
      [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)]; 
     } 
     else 
     { 
      [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)]; 
     } 

    } 

    [UIView commitAnimations]; 





} 

- (void) showTabBar:(UITabBarController *) tabbarcontroller { 

    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:0.5]; 
    for(UIView *view in tabbarcontroller.view.subviews) 
    { 
     NSLog(@"%@", view); 

     if([view isKindOfClass:[UITabBar class]]) 
     { 
      [view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)]; 

     } 
     else 
     { 
      [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)]; 
     } 


    } 

    [UIView commitAnimations]; 
} 
+0

어디로 갈까요? –

+0

이 함수를 전역 파일에 넣을 수 있으며 tabbarcontroller ..를 숨기려면 hide 함수를 호출하고 tabbarcontroller를 표시하는 함수를 호출하면됩니다. 이러한 메서드는 - [commonFunctions hideTabBar : self.tabbarcontroller]와 같이 호출 할 수 있습니다. – Saurabh

+0

viewController에서 숨길 수 없다는 것을 시도해 보았습니다. –

4

는이 작업을 설정합니다. VC를 밀거나 컨피규레이션을하는 맥락에서 당신이하고있는 일이 무엇인지 잘 모르겠지만 잘 작동합니다. 그것은 내 애플 리케이션 에서이 정확한 일을하는 방법입니다.

0

나는 그것은 이후의 전망에 탭 표시 줄을 제거 does'nt

myVC.hidesBottomBarWhenPushed = YES; 

과 같은 문제에 직면했습니다. 사용 중지 될 수 있습니다. 당신은 setHidesBottomBarWhenPushed : 명령으로이 문제에 직면해서는 안됩니다. 보기를 위해 다음을 사용하십시오 :

MyViewController *myVC = [[[MyViewController alloc] init] autorelease]; 
[myVC setHidesBottomBarWhenPushed:YES]; 
[self.navigationController pushViewController:myVC animated:YES];