0
這是有問題的代碼無不與預期參數類型兼容「NSLayoutAnchor <NSLayoutDimention>」
// auto layout
let vertivalConstraint = textField.centerYAnchor.constraint(equalTo: self.codeView.centerYAnchor)
let leadingConstraint = textField.leadingAnchor.constraint(equalTo: self.codeView.leadingAnchor, constant: 10)
let trailingConstraint = textField.trailingAnchor.constraint(equalTo: self.codeView.trailingAnchor, constant: -10)
let heightConstraint = textField.heightAnchor.constraint(equalTo: nil, constant: 37)
NSLayoutConstraint.activate([leadingConstraint, vertivalConstraint, trailingConstraint, heightConstraint])
讓heightConstraint在標題返回錯誤。我將如何去解決這個問題。
感謝
這是在GitHub上發現了一個自動完成腳本並轉換爲最新的快速。需要值來激活NSLayout Contraint –