jjzjj

constraintsWithVisualFormat

全部标签

ios - 无法在 swift 2 中转换类型为 '[NSLayoutConstraint]' 的值错误

我想通过添加这行代码来向UIImageView添加约束:addConstraint(NSLayoutConstraint.constraintsWithVisualFormat("H:|[v0]|",options:NSLayoutFormatOptions(),metrics:nil,views:["v0":userProfileImageView]))但是xcode告诉我这个错误:我该如何修复这个错误? 最佳答案 使用addConstraints,而不是addConstraint。constraintsWithVisualFor
12