我不知道如何将 constrant.height 设置为常量值:
override func updateConstraints() {
layout(view) { view in
let viewHeight = 67
view.top == view.superview!.top
view.left == view.superview!.left
view.height == viewHeight // Error: Binary operator '==' cannot be applied to operands of type 'Dimension' and 'Int'
view.width == view.superview!.width
}
super.updateConstraints()
}
这应该很简单,作为一个 Swift 新手 atm 我没有任何工作想法,欢迎任何帮助:)