Autolayout관련 질문 #22
Answered
by
z3rosmith
Chuncheonian
asked this question in
Q&A
-
code로 UILabel과 UITextField를 밑의 코드처럼 짰는데 UILabel의 width가 이상하게 잡히네요. 어떻게 하면 제대로 될까요? view.addSubview(nameLabel)
nameLabel.sizeToFit()
nameLabel.snp.makeConstraints { make in
make.top.equalTo(divider.snp.bottom).offset(31)
make.leading.equalTo(self.view.safeAreaLayoutGuide.snp.leading).offset(16)
}
view.addSubview(nameTextField)
nameTextField.snp.makeConstraints { make in
make.leading.equalTo(nameLabel.snp.trailing).offset(18)
make.bottom.equalTo(nameLabel.snp.bottom)
make.trailing.equalTo(self.view.safeAreaLayoutGuide.snp.trailing)
} |
Beta Was this translation helpful? Give feedback.
Answered by
z3rosmith
Nov 18, 2021
Replies: 1 comment 1 reply
-
nameLabel의 크기에따라 nameTextField의 크기를 유동적으로 하고싶으신건가요? 만약에 그렇다면 nameTextField의 Hugging Priority를 251에서 250으로 낮춰보세요! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Chuncheonian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nameLabel의 크기에따라 nameTextField의 크기를 유동적으로 하고싶으신건가요? 만약에 그렇다면 nameTextField의 Hugging Priority를 251에서 250으로 낮춰보세요!