【发布时间】:2016-05-20 11:05:25
【问题描述】:
我想在我的UIViewController 底部添加一个静态UIView。这是一个用 swift 编写的故事板应用程序。在我的viewDidLoad() 中,我做了这样的事情。
self.vWindow = UIApplication.sharedApplication().keyWindow
let mainBound = CGRectMake(0, self.view.frame.size.height-135, self.view.frame.size.width, 135)//CGSizeMake(UIScreen.mainScreen().bounds.size.width, 135.0)
self.vwVideo = UIView.init(frame: mainBound)
self.vwVideo.backgroundColor = UIColor.blackColor()
self.vWindow.addSubview(self.vwVideo)
但这对我的viewController 没有任何帮助。这是为什么?请帮我。
谢谢
【问题讨论】:
-
你可以像这样添加它:self.view.addSubView(self.vwVideo)
标签: ios swift uiview uiviewcontroller