2014-04-24 4 views
1

UITabBar을 숨기는 데 문제가 있습니다. 나는 사용자 정의 TabBar를 사용하여 다음을 사용하여 숨 깁니다.iOS 7 - TabBar를 숨기고 대신 toolBar 표시

self.frame = CGRectOffset(tabBarRect, 0, CGRectGetHeight(tabBarRect)); 

tabBar 대신 toolBar를 표시하려고합니다. 모든 것은 괜찮아 보이지만, 이전에 tabBar가 차지하고 있던 영역은 탭바 프레임을 오프셋했지만 응답하지 않습니다.

toolBar.frame = CGRectMake(0, CGRectGetHeight(tbv.frame) - toolBar.intrinsicContentSize.height, CGRectGetWidth(self.view.frame), toolBar.intrinsicContentSize.height); 
    [tbv addSubview:toolBar]; 

는 불행하게도 내 한 tabBar 툴바보다 큰, 그래서 나는이 솔루션을 사용할 수 없습니다

그래서, 난 그냥 한 tabBar의 하위 뷰 같은 도구 모음을 넣어. appDelegate의 keyWindow와 tabBar 위에 toolBar를 추가 할 수 있지만 viewController 내에 배치하고 싶습니다.

tabBar를 사용하지 않도록 설정하고 tabBar를 사용하여 탐색 기반 앱의 일부인 현재 viewController 내에서 toolBar 또는 제스처가있는 다른 컨트롤을 사용할 수 있습니까?

감사합니다 유

답변

0

이 같은 self.hidesBottomBarWhenPushed =YES;

을 시도 할 수 있습니다 :

self.hidesBottomBarWhenPushed =YES;//hide controller's tabbar 

UIViewController *controller =[self.storyboard instantiateViewControllerWithIdentifier:@"MyRequirementParticipateInViewController"]; 

[self.navigationController pushViewController:controller animated:YES]; 

self.hidesBottomBarWhenPushed =NO;//when pushed back tabbar would show again. 
+0

감사 잭,하지만 사용자가 버튼을 탭하면, 그때 보이는 한 tabBar로 기선을 제압 당했지만, 수 동일의 ViewController 필요 , toolBar는 tabBar를 대체해야합니다. 그리고 나는 같은 viewController를 인스턴스화하지 않는다. –