我试图在所有TabBarController上添加一个View,我试过这个:
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
以测试绘制videoController并且工作正常。问题是:我无法合并视图。