如何在iOS中的uitabbarcontroller内部切换视图

时间:2015-11-23 10:20:37

标签: ios uitabbarcontroller

我正在使用UITabBarcontroller,我希望在UISegmentController之间切换视图,但点击UITabBarItem时不应隐藏UISegmentController

if([sender selectedSegmentIndex] == 0)
{
//            UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
//            UITabBarController *wc = [mystoryboard instantiateViewControllerWithIdentifier:@""];
//            [self.navigationController pushViewController:wc animated:YES];            

}
else if([sender selectedSegmentIndex] == 1)
{
   UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
   UITabBarController *wc = [mystoryboard instantiateViewControllerWithIdentifier:@"ProfileViewController"];
   [self.navigationController pushViewController:wc animated:YES];
}

This is the image with uisegmentcontroller

This is the structure is used using container view

0 个答案:

没有答案