Ios 在选项卡栏及其控制器上添加子视图
我试图在all TabBarController上添加一个视图,我尝试了以下方法:Ios 在选项卡栏及其控制器上添加子视图,ios,swift,autolayout,uitabbarcontroller,addsubview,Ios,Swift,Autolayout,Uitabbarcontroller,Addsubview,我试图在all TabBarController上添加一个视图,我尝试了以下方法: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.window = UIWindow(frame: CGRectMake(0, 0, CGRectGetWidth(UIScree
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: CGRectMake(0, 0,
CGRectGetWidth(UIScreen.mainScreen().bounds),
CGRectGetHeight(UIScreen.mainScreen().bounds)))
self.window!.backgroundColor = UIColor.whiteColor()
let tabBar : UITabBarController = UITabBarControllerHelper.generate() //Create the TabBarController, works fine
let videoController : UIViewController = VideoViewController()
videoController.view.layer.zPosition = 1
tabBar.view.addSubview(videoController.view)
self.window!.rootViewController = tabBar
self.window!.makeKeyAndVisible()
return true
}
但这不起作用,只渲染TabBarController。我更改了self.window!。rootViewController
测试绘制视频控制器,效果也很好。问题是:我无法合并视图