새로운 기능인 ios입니다. Tabbar 컨트롤러에 문제가있었습니다. 내 프로젝트에서 두 개의 탭 막대 컨트롤러를 사용하고 있습니다. 하나는 점심 시간에로드되고 잘 작동합니다. 다른 행을로드하려고합니다. 어떻게해야합니까? 나는 많은 실험을했지만 아무것도 작동하지 않습니다.내비게이션 컨트롤러를 사용하여 tabbar 컨트롤러 xib를로드하는 방법
답변
-(void) hidetabbar {
[UIView animateWithDuration:0.5
animations:^{
for(UIView *view in tabBarController.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
if (hiddenTabBar) {
[view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
}
} else {
if (hiddenTabBar) {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}
}
}];
hiddenTabBar = !hiddenTabBar;
}
when u r clicking on the table view did select row hide the tabbar in the viewcontroller that u r sending
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:YES];
[((AppDelegate*)[[UIApplication sharedApplication]delegate]) hidetabbar];
}
-(void)tabBarControllerView
{
tabBarController = [[UITabBarController alloc] init];
tabBarController.view.backgroundColor = [UIColor blackColor];
tabBarController.delegate = self;
//Add some tabs to the controller...
//----First tab----//
//-----second Tab -----//
//------3rd tab--//
//-----4th tab bar--------//
//-----5th tab bar--------//
[self.view addSubview:tabBarController.view];
[navigationController pushViewController:tabBarController animated:YES];
tabBarController.tabBar.tag=100;
tabBarController.view.hidden = NO;
}
- (void)tabBarController:(UITabBarController *)tabBarControllers didSelectViewController:(UIViewController *)viewController
{
if (tabBarControllers.selectedIndex == 0)
{
}
else if (tabBarControllers.selectedIndex == 1)
{
}
else if (tabBarControllers.selectedIndex == 2)
{
}
else if (tabBarControllers.selectedIndex == 3)
{
}
else if (tabBarControllers.selectedIndex == 4)
{
}
}
통해 UR이 테이블 선택을했고, 또 다른 탭 표시 줄을 추가하고 해당 뷰 컨트롤러의 주요 탭 표시 줄을 숨기 .. 는 didSelect 이벤트에 다음 코드를 추가는 U에게
안녕하세요, 내 부모보기 컨트롤러 tabbar 컨트롤러입니다. didselect 행에서 새 tabbar 컨트롤러를로드하려고합니다. 그것을 수행하는 방법 – user1376474
ur 부모보기 탭 막대 컨트롤러에 태그 값을주고 행을 선택하면 다른보기 컨트롤러로 이동합니다. tabcontroller보기 개체를 확인하고 태그 값의 도움으로 탭 막대를 제거합니다. cotroller보기 및 그 클래스의 새 탭 표시 줄 컨트롤러를 추가하십시오 – 08442
도움이 될이 같은 몇 가지 일을하려고 [당신이 시도 무엇]
UITabBarController *tabBarController = [[UITabBarController alloc]init];
NSArray*tabBarimageArray=[NSArray arrayWithObjects:@"firstTabImage.png",@"secondTabImage.png", nil];
YourFirstTabRootViewController *firstVc = [[YourFirstTabRootViewController alloc]initWithNibName:@"YourFirstTabRootViewController" bundle:nil];
UINavigationController *firstNavigationController=[[UINavigationController alloc]initWithRootViewController:firstVc];
YourSecondTabRootViewController *secondVc = [[YourSecondTabRootViewController alloc]initWithNibName:@"YourFirstTabRootViewController" bundle:nil];
UINavigationController *secondNavigationController=[[UINavigationController alloc]initWithRootViewController:secondVc];
NSArray *VCs = [[NSArray alloc] initWithObjects:firstNavigationController,secondNavigationController nil];
NSArray *names = [NSArray arrayWithObjects:
NSLocalizedString(@"Tab1", @""),
NSLocalizedString(@"Tab2", @""),
nil];
NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] initWithCapacity:[VCs count]];
NSInteger index = 0;
for (id controller in VCs) {
UINavigationController * navController = controller ;
// THIS SETS UP THE TAB BAR ITEMS/IMAGES AND SET THE TAG FOR TABBAR_ITEM_TAGS
NSString *tabName = [names objectAtIndex:index];
UIImage *tabImage = [UIImage imageNamed:[NSString stringWithFormat:[tabBarimageArray objectAtIndex:index]]];
navController.title = tabName;
UITabBarItem *tempTab = [[UITabBarItem alloc] initWithTitle:tabName
image:tabImage
tag:index];
navController.tabBarItem = tempTab;
[tabBarViewControllers addObject:navController];
index ++;
}
[ tabBarController setViewControllers:tabBarViewControllers];
[self presentModalViewController:tabBarController animated:YES];
부모 탭 표시 줄을 숨기는 방법 ... – user1376474
- 1. 내비게이션 컨트롤러에서 TabBar 컨트롤러 푸시
- 2. iOS TabBar 및 내비게이션 컨트롤러
- 3. 내비게이션 컨트롤러를 tabbar 컨트롤러와 함께 사용
- 4. 새 컨트롤러를 밀고 내비게이션 컨트롤러
- 5. TabBar 컨트롤러 및 NavigationBar
- 6. 탭바 컨트롤러에 내비게이션 컨트롤러 구현
- 7. 다음에 Tabbar 컨트롤러를 표시하는 방법
- 8. DetailViewController에 내비게이션 컨트롤러를 제공하는 방법?
- 9. iOS - AppDelegate의 내비게이션 컨트롤러
- 10. 내비게이션 컨트롤러를 밀고 팝합니까?
- 11. 앱 파일에서 내비게이션 컨트롤러 및 탭 막대 컨트롤러를 사용하는 방법
- 12. 내비게이션 컨트롤러를 종료하는 방법? 레스토랑에 대한
- 13. 삽입 내비게이션 컨트롤러
- 14. 내비게이션 컨트롤러 관련 문제
- 15. TabBar 컨트롤러를 숨기기
- 16. TabBar 컨트롤러를 사용하여 뷰를 다시로드/다시 할당
- 17. 내비게이션 컨트롤러를 UIViewController에 추가하십시오.
- 18. 내비게이션 컨트롤러 관련 질문
- 19. 내비게이션 컨트롤러
- 20. 내비게이션 컨트롤러를 어떻게 전환합니까?
- 21. 다른 클래스의 xib를로드하는 방법
- 22. 네비게이션 컨트롤러 방향이있는 Tabbar 컨트롤러 6
- 23. 앱 대리인없이 내비게이션 컨트롤러 설정
- 24. 여러보기 컨트롤러를 내비게이션 컨트롤러에 푸시하는 방법
- 25. IOS. 내비게이션 컨트롤러. 재사용 ViewController
- 26. 맞춤형 테이블보기에 내비게이션 컨트롤러 추가
- 27. 내비게이션 컨트롤러 버튼 오른쪽
- 28. 가로 모드의 tabbar 컨트롤러
- 29. iPhone TabBar 컨트롤러 사용
- 30. Tabbar 더보기 컨트롤러 아이폰
(http://mattgemmell.com/2008/12/08/what-have-you-tried/) – akk
귀하의 질문 제목과 설명이 다른 것을 알 것 같다 질문. 당신은 실제로 무엇을하고 싶습니까? 상위 뷰 컨트롤러는 무엇입니까? NavigationController 또는 Tabbarcontroller? – Neo