【问题标题】:Can't "addSubView"不能“addSubView”
【发布时间】:2014-06-03 08:56:17
【问题描述】:

错误 -> 'UIVIew' 没有名为 'addSubView' 的成员

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    var testView = UIView(frame: CGRectMake(0, 0, 320, 568))
    testView.backgroundColor = UIColor.redColor()
    self.view.addSubView(testView)
}

【问题讨论】:

    标签: ios swift


    【解决方案1】:

    我猜是因为大写字母“V”。 试试

     self.view.addSubview(testView)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-21
      • 2012-10-12
      • 1970-01-01
      • 1970-01-01
      • 2014-09-07
      相关资源
      最近更新 更多