self.navigationController.tabBarController.selectedIndex not working

前端 未结 7 2028
野趣味
野趣味 2021-01-14 02:07

I have a UITabBarController which containing 4 different UIViewControllers.

On first tab there is a UINavigationViewController

相关标签:
7条回答
  • 2021-01-14 03:10

    we should put follow section in viewDidAppear.

        - (void)viewDidAppear:(BOOL)animated
    {
    NSArray *ary = [self.tabBarController viewControllers];
        UIViewController *vc = ary[3];
        [self.tabBarController setSelectedIndex:3];
        [self.tabBarController setSelectedViewController:vc];
    }
    
    0 讨论(0)
提交回复
热议问题