UITabBarControllerUINavigationController 相结合代码

    技术2022-05-20  30

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

     

    SecondViewController *secondViewCtrl1=[[SecondViewController alloc]init];

    UINavigationController *navCtrl1=[[UINavigationController alloc]initWithRootViewController:secondViewCtrl1];

    [secondViewCtrl1 release];

     

    TabBarViewController *secondViewCtrl2=[[TabBarViewController alloc]init];

    UINavigationController *navCtrl2=[[UINavigationController alloc]initWithRootViewController:secondViewCtrl2];

    [secondViewCtrl2 release];

     

    NSArray *array=[NSArray arrayWithObjects:navCtrl1,navCtrl2,nil];

    tabBarCtr.viewControllers=array;

    [self presentModalViewController:tabBarCtr animated:YES];


    最新回复(0)