2010-02-22 7 views
1

저는 아이폰 개발을 처음 접했습니다. 뷰 기반의 애플리케이션을 만들었습니다. 이제 그 뷰에서 탭 바를 원합니다. 탭 바의 첫 번째 뷰는 테이블 뷰이고 두 번째 뷰는 웹 뷰입니다. 모든 자습서 탭 막대 기반 응용 프로그램 만 설명하십시오. 내가보기에 기반 응용 프로그램을 사용하고 있기 때문에 정말로 힘들다는 것을 알았습니다. 인터페이스 빌더를 사용하여 어떻게 달성 할 수 있습니까? 가이드 안내. 모든 샘플 자습서가 더 유용 할 것입니다. 제발 도와주세요. 감사합니다.보기 기반 응용 프로그램의 탭 표시 줄?

+0

"탭바 응용 프로그램"으로 다시 시작할 수 있습니까? – kennytm

+0

이것은 http://stackoverflow.com/questions/2326814/how-to-add-tabbarcontroller-in-viewcontroller-in-iphone/ –

+0

@ Kristopher의 복제본입니다. 나는이 질문에 9 일 전에 질문했고 푸갈은 7 일 전에 질문 해. 내가 어떻게 복제 할 수 있니? – Warrior

답변

4

시도해보십시오. 이 코드는 프로그래밍 방식으로 탭 표시 줄 응용 프로그램을 만들었습니다. 버튼을 클릭하면보기의 탭 표시 줄이 열립니다.

-(IBAction) clkBtn:(id) sender 
    { 

    UITabBarController *tabbar1 = [[UITabBarController alloc] init]; 

    firstViewController *first = [[firstViewController alloc] initWithNibName:@"firstViewController" bundle:nil]; 

    UINavigationController *tabItem1 = [[[UINavigationController alloc] initWithRootViewController: first] autorelease]; 

    secondViewController *second = [[secondViewController alloc] initWithNibName:@"secondViewController" bundle:nil]; 

    UINavigationController *tabItem2 = [[[UINavigationController alloc] initWithRootViewController: second] autorelease]; 

    tabbar1.viewControllers = [NSArray arrayWithObjects:tabItem1, tabItem2,nil]; 

    [self.view insertSubview:tabbar1.view belowSubview: first.view]; 

    [self presentModalViewController:tabbar1 animated:YES]; 

    } 

감사합니다, 행운을 빕니다

.

+0

푸시 뷰 컨트롤러에서 작동합니까? – Warrior

+0

@Warrior. 네,보기에 탐색 컨트롤러를 추가했기 때문입니다. 그래서 그것은 전망을 밀어 낸다. – Pugal

+0

감사합니다. 아주 좋은 답변입니다 – Warrior

관련 문제