跳转到uitabbarController时出现了下面的BUG
我的部分代码如下:
equipmentViewController * equip=[[equipmentViewController alloc]init];
myNavigationController *nav3=[self NavigationControllerWithviewController:equip title:@"服务" image:@"fuwu@2x" selectedImage:@"fuwuselected@2x"];
settingViewController * set=[[settingViewController alloc]init];
myNavigationController *nav4=[self NavigationControllerWithviewController:set title:@"设置" image:@"shezhi@2x" selectedImage:@"shezhiselected@2x"];
self.viewControllers=@[nav,nav1,nav2,nav3,nav4];
后来经过测试,把uitabbarController添加子视图的方法由self.viewControllers=@[nav,nav1,nav2,nav3,nav4];改成 [self addChildViewController:nav];(剩下的我就不一一写出来了)就好了。
equipmentViewController * equip=[[equipmentViewController alloc]init];
myNavigationController *nav3=[self NavigationControllerWithviewController:equip title:@"服务" image:@"fuwu@2x" selectedImage:@"fuwuselected@2x"];
settingViewController * set=[[settingViewController alloc]init];
myNavigationController *nav4=[self NavigationControllerWithviewController:set title:@"设置" image:@"shezhi@2x" selectedImage:@"shezhiselected@2x"];
// self.viewControllers=@[nav,nav1,nav2,nav3,nav4];
[self addChildViewController:nav];
[self addChildViewController:nav1];
[self addChildViewController:nav2];
[self addChildViewController:nav3];
[self addChildViewController:nav4];