Skip to content

Commit

Permalink
[#142] message view width 재조정
Browse files Browse the repository at this point in the history
  • Loading branch information
meenyweeny committed Aug 13, 2022
1 parent 859572d commit 7632940
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ final class MessageDetailViewController: UIViewController {

// MARK: - Property

var content: String = ""
internal var content: String = ""
private let messageWidth = UIScreen.main.bounds.width - 175

// MARK: - UI Property

Expand Down Expand Up @@ -69,11 +70,9 @@ final class MessageDetailViewController: UIViewController {
}

private func setDynamicHeight() {
let height = contentLabel.frame.height < 145 ? 200 : contentLabel.layer.frame.height + 80
messageView.snp.remakeConstraints { make in
make.width.equalTo(200)
let height = contentLabel.frame.height < 145 ? messageWidth : contentLabel.layer.frame.height + 80
messageView.snp.updateConstraints { make in
make.height.equalTo(height)
make.centerX.centerY.equalTo(view.safeAreaLayoutGuide)
}
}

Expand All @@ -84,8 +83,7 @@ final class MessageDetailViewController: UIViewController {

private func setConstraint() {
messageView.snp.makeConstraints { make in
make.width.equalTo(200)
make.height.equalTo(200)
make.width.height.equalTo(messageWidth)
make.centerX.centerY.equalTo(view.safeAreaLayoutGuide)
}

Expand Down

0 comments on commit 7632940

Please sign in to comment.