我有一个动态的UITextView,需要在右下方添加一个UILabel。此标签应始终为0(触摸)textView的底部。
我已经尝试过这样的约束,但是无法使其按预期工作。
self.dateOfComment.topAnchor.constraint(equalTo: 0).isActive = true
如何使此功能起作用?
答案 0 :(得分:2)
您需要
self.lbl.topAnchor.constraint(equalTo:textView.bottomAnchor).isActive = true