我有自己的UITabBarViewController子类。是否可以更改所有嵌入的视图控制器视图的框架,以便部分显示自己的UITabBarViewController视图?
在附加的图像上,我为自己的tabBarController视图设置了紫色。
我想更改每个选定视图控制器的框架,以便此紫色视图(UITabBarController视图)可见。
我有自己的UITabBarViewController子类。是否可以更改所有嵌入的视图控制器视图的框架,以便部分显示自己的UITabBarViewController视图?
在附加的图像上,我为自己的tabBarController视图设置了紫色。
我想更改每个选定视图控制器的框架,以便此紫色视图(UITabBarController视图)可见。
UIViewController *wrapperController = [UIViewController new];
wrapperController.backgroundColor = [UIColor clearColor];
[wrapperController addChildViewController:vc];
[wrapperController.view addSubview:vc.view];
vc.view.frame = CGRectMake(...);
只需确保将tabbarItem传递给包装器,并使用该项代替子项即可。