适合于在xib拖控件然后内容由代码编写的,本之前一直在苦恼怎么从一个普通页面跳转到带TabbarControl的页面,直接跳到里面的其中一个页面会造成tabbaritem消失,最后由这行代码解决了我的问题:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@”storyboard的名字,一般默认为Main” bundle:nil];
UIViewController *tabBarController = [storyboard instantiateViewControllerWithIdentifier:@”在storyboard给该视图添加identity-storyboard ID 然后这里填写该ID即可”];
tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:tabBarController animated:YES completion:^{
}];