2
UITabBarController의 탭 중 하나에 대해 ViewContoller (및 View)를 변경/교체 할 수 있습니까?TabBarItem에 대한 ViewController 변경
특정 Tab에서 임의의 순서로 3 개의 다른 ViewController 사이를 전환하고 싶습니다 (NavigationController를 사용할 수없는 이유).
UITabBarController의 탭 중 하나에 대해 ViewContoller (및 View)를 변경/교체 할 수 있습니까?TabBarItem에 대한 ViewController 변경
특정 Tab에서 임의의 순서로 3 개의 다른 ViewController 사이를 전환하고 싶습니다 (NavigationController를 사용할 수없는 이유).
setViewController : animated를 사용하여 (질량으로) 설정됩니다. 이렇게하면 될 수 있습니다.
// Assume tabController is the tab controller
// and newVC is the controller you want to be the new view controller at index 0
NSMutableArray *newControllers = [NSMutableArray arrayWithArray:tabController.viewControllers];
[newControllers replaceObjectAtIndex:0 withObject:newVC];
[tabController setViewControllers:newControllers animated:YES];
희망이 있습니다.
감사합니다. 그것은 ViewController를 대체했습니다. 그러나 TabBarItem이 복원되고 아이콘/텍스트가 사라졌습니다. tabBarItem에 속한 ViewController 중 하나에서이 작업을 수행했는데 괜찮 았을 수 있습니다. –