2009-07-24 2 views
0

안녕하세요 여러분, 질문 상태처럼 presentModalViewController 또는 pushViewController를 사용하지 않고 UIDatePicker에서 슬라이드하려고하고 이후에 응용 프로그램의 기본 UITabBar를 숨길 수 있습니다. 지금 당장은 UIDatePicker 서브 뷰에 네비게이션 바의 몇 개의 버튼을 임시 UIViewController에 추가하고 그 임시 컨트롤러를 루트로 사용하여 UINavigationController를 초기화하고 있습니다. 이 탐색 컨트롤러를 UITabBar를 오버레이하려고 시도 할 때 self.navigationController.tabBarController의 하위 뷰로 추가하지만 UITabBar를 숨김으로 설정하면 UIDatePicker가 보이지 않는 흰색이 아래에 흰색으로 표시됩니다. 어떤 제안?iphone - presentModalViewController 또는 pushViewController없이 UITabBar 숨기기

참고 : 내 추론은 내가 화면보다 작은보기로 presentModalViewController를 사용하는 방법을 알아낼 수 없다는 것입니다.

답변

5

대답 here,의 UITabBar

숨기기

UPDATE :

BOOL hiddenTabBar; UITabBarController *tabBarController; - (void) hideTabBar { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.4]; for(UIView *view in tabBarController.view.subviews) { CGRect _rect = view.frame; if([view isKindOfClass:[UITabBar class]]) { if (hiddenTabBar) { _rect.origin.y = 431; [view setFrame:_rect]; } else { _rect.origin.y = 480; [view setFrame:_rect]; } } else { if (hiddenTabBar) { _rect.size.height = 431; [view setFrame:_rect]; } else { _rect.size.height = 480; [view setFrame:_rect]; } } } [UIView commitAnimations]; hiddenTabBar = !hiddenTabBar; } 

UPDATE 링크

에서 코드 : 모두 아이 패드에서 작동하는 코드를 수정
(시뮬레이터에서 테스트) & 아이폰 (테스트하지, 하지만 잘하면 작동 할 것입니다) https://stackoverflow.com/a/8584684/336422

0

Apple의 DateCell 예제를 사용해도 좋습니다. UIDatePicker는 becomeFirstResponder를 호출 할 때 UITextField의 키보드처럼 아래에서 슬라이드합니다.