如何向标签添加约束,使其始终与动态的 UITextView 相距 0 点?
How can I add a constraint to a label such that it is always 0 points away from a UITextView which is dynamic?
我有一个动态的 UITextView,需要在下面添加一个 UILabel。此标签应始终为 0(接触)textView 的底部。
我已经尝试过这样的约束,但无法使其按预期工作。
self.dateOfComment.topAnchor.constraint(equalTo: 0).isActive = true
我怎样才能使用这个功能?
我有looked here also
你需要
self.lbl.topAnchor.constraint(equalTo:textView.bottomAnchor).isActive = true
我有一个动态的 UITextView,需要在下面添加一个 UILabel。此标签应始终为 0(接触)textView 的底部。
我已经尝试过这样的约束,但无法使其按预期工作。
self.dateOfComment.topAnchor.constraint(equalTo: 0).isActive = true
我怎样才能使用这个功能?
我有looked here also
你需要
self.lbl.topAnchor.constraint(equalTo:textView.bottomAnchor).isActive = true