我有这样的观点:
当我执行特定操作时,我想显示一个视图。这些是我的约束:
self.view.addSubview(messageView)
let leftConstraint = messageView.leftAnchor.constraintEqualToAnchor(self.myTableView.leftAnchor)
let bottomConstraint = messageView.bottomAnchor.constraintEqualToAnchor(self.myTableView.bottomAnchor)
let highConstratin = messageView.heightAnchor.constraintEqualToConstant(44.0)
let widthConstraint = messageView.widthAnchor.constraintEqualToAnchor(self.myTableView.widthAnchor)
NSLayoutConstraint.activateConstraints([leftConstraint, bottomConstraint, highConstratin, widthConstraint])
self.view.translatesAutoresizingMaskIntoConstraints = false
self.view.setNeedsDisplay()
但问题是视图只是在左上角添加,就像约束不起作用一样,
请看
我想念的是什么?