2011-01-06 3 views
1

내 응용 프로그램은 탐색 기반 응용 프로그램입니다.이 응용 프로그램에서 UIViewController는 button 이벤트를가집니다. Button 발사 버튼을 눌러 (pushViewController) CalendarTableview로 이동하십시오. 이제 tabbar 및 tabitem을 calendartableview에 추가해야합니다. Tabbar 및 tabitem을 CalendarTableview에 추가하는 방법. 도와주세요 .uitableview에 tabbar를 추가하는 방법

여기 내 그림입니다. alt text 감사합니다. 당신의 calendartableview_controller의 viewDidLoad에() 메소드에서

답변

1

는 프로그램 탭 표시 줄을 만들려고 한 다음 calendartableview_controller의 보기에 하위 뷰로 추가 :

//create a tab bar controller in your calendartableview_controller 
    UITabBarController *tabBarController = [[UITabBarController alloc] init]; 
    tabBarController.title = @"My Tab Bar"; 

    //assign child controllers to the tab bar controller 
    tabBarController.viewControllers = [NSArray arrayWithObjects:firstViewController, secondViewController, thirdViewController, nil]; 

    //add it to your calendartableview_controller's view as a subview 
    [self.view addSubview:[tabBarController view]]; 
+0

@Rkm : 구조는 전적으로 귀하에게 달려 있습니다. 보시다시피, 하나의 viewController가 ** 탭 막대에 ** ** 제어되도록하려면 그 vc는 탭 막대의 자식 중 하나입니다. 사례로 돌아가서 이러한 탭 표시 줄이 코드에 맞춰 지도록 UI 구조를 다시 구성해야 할 수도 있습니다. –

+0

나는 애플 문서를 따르고 있는데, 모두 Darg down tabbar를 tabbarcontroller의 메인 윈도우에 연결하고 navigation bar에 tableview 연결을 제공한다고 나는 혼란 스럽다. 나는 얻지 않는다, 나는 나의 그림을 배치했다, 나는 명확하지 않다. 제발 말해줘 , – SOF

관련 문제