Skip to content

Commit

Permalink
#73 Fix: 와인 이름 길이 및 AutoLayout 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dlguszoo committed Aug 19, 2024
1 parent 08eb6e2 commit e3ff7fd
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class CartListCollectionViewCell: UICollectionViewCell {
l1.text = "Loxton"
l1.font = .boldSystemFont(ofSize: 18)
l1.textColor = .black
l1.numberOfLines = 0
l1.adjustsFontSizeToFitWidth = true // 텍스트가 레이블 너비에 맞도록 크기 조정
l1.numberOfLines = 2
l1.lineBreakMode = .byTruncatingTail // 생략 부호(...)가 꼬리에 위치하도록 설정
return l1
}()

Expand Down Expand Up @@ -238,9 +238,10 @@ class CartListCollectionViewCell: UICollectionViewCell {

name.snp.makeConstraints { make in
make.top.equalToSuperview().offset(13)
make.leading.equalTo(imageView.snp.trailing).offset(15)
// make.trailing.equalTo(deleteButton.snp.leading).inset(10)
make.width.lessThanOrEqualTo(185)
make.leading.equalTo(imageView.snp.trailing).offset(13)
if UIDevice.current.userInterfaceIdiom == .phone {
make.width.lessThanOrEqualTo(185)
}
make.height.lessThanOrEqualTo(45)
}

Expand All @@ -266,7 +267,6 @@ class CartListCollectionViewCell: UICollectionViewCell {
NumLabel.snp.makeConstraints { make in
make.centerX.centerY.equalToSuperview()
}

deleteButton.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.trailing.equalToSuperview().inset(14)
Expand Down
23 changes: 12 additions & 11 deletions Drink-EG/Drink-EG/Sources/VCs/Search/ReviewListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class ReviewListViewController: UIViewController {
let l = UILabel()
l.font = .boldSystemFont(ofSize: 22)
l.textColor = .black
l.numberOfLines = 0
l.adjustsFontSizeToFitWidth = true // 텍스트가 레이블 너비에 맞도록 크기 조정
l.numberOfLines = 2
l.lineBreakMode = .byTruncatingTail // 생략 부호(...)가 꼬리에 위치하도록 설정
return l
}()

Expand Down Expand Up @@ -125,20 +125,21 @@ class ReviewListViewController: UIViewController {
make.height.lessThanOrEqualTo(140)
}

view.addSubview(name)
name.snp.makeConstraints { make in
make.top.equalTo(image)
make.leading.equalTo(image.snp.trailing).offset(16)
make.width.lessThanOrEqualTo(175)
make.height.lessThanOrEqualTo(80)
}

view.addSubview(scoreLabel)
scoreLabel.snp.makeConstraints { make in
make.top.equalTo(name.snp.top)
make.top.equalTo(image.snp.top)
make.trailing.equalTo(view.safeAreaLayoutGuide).inset(20)
}

view.addSubview(name)
name.snp.makeConstraints { make in
make.top.equalTo(image.snp.top)
make.leading.equalTo(image.snp.trailing).offset(13)
make.trailing.equalTo(scoreLabel.snp.leading).offset(-10)
// make.width.lessThanOrEqualTo(175)
make.height.lessThanOrEqualTo(80)
}

customPickerButton.setupPickerView(pickerView, toolbar: toolbar, pickerData: pickerData)
view.addSubview(customPickerButton)

Expand Down
23 changes: 12 additions & 11 deletions Drink-EG/Drink-EG/Sources/VCs/Search/WineInfoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,26 +287,27 @@ class WineInfoViewController: UIViewController {
make.width.equalTo(imageView.snp.height)
}

infoView.addSubview(score)
score.snp.makeConstraints { make in
make.top.equalToSuperview().offset(13)
make.trailing.equalToSuperview().inset(15)
}

infoView.addSubview(name)
name.snp.makeConstraints { make in
make.top.equalToSuperview().offset(10)
make.leading.equalTo(imageView.snp.trailing).offset(13)
make.width.lessThanOrEqualTo(205)
make.leading.equalTo(imageView.snp.trailing).offset(10)
make.trailing.equalTo(score.snp.leading).offset(-10)
// make.width.lessThanOrEqualTo(205)
make.height.lessThanOrEqualTo(40)
}

infoView.addSubview(specInfo)
specInfo.snp.makeConstraints { make in
make.top.equalTo(name.snp.bottom).offset(10)
make.top.equalTo(name.snp.bottom).offset(8)
make.leading.equalTo(name)
make.width.lessThanOrEqualTo(255)
make.height.lessThanOrEqualTo(38)
}

infoView.addSubview(score)
score.snp.makeConstraints { make in
make.top.equalTo(name.snp.top)
make.trailing.equalToSuperview().inset(15)
make.trailing.equalToSuperview().offset(-10)
make.height.lessThanOrEqualTo(37)
}

contentView.addSubview(tastingNoteView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class WineOrderViewController: UIViewController {
private let name: UILabel = {
let l = UILabel()
l.text = "Red Label"
l.font = .boldSystemFont(ofSize: 22)
l.font = .boldSystemFont(ofSize: 20)
l.textColor = .black
l.numberOfLines = 0
l.adjustsFontSizeToFitWidth = true // 텍스트가 레이블 너비에 맞도록 크기 조정
l.numberOfLines = 2
l.lineBreakMode = .byTruncatingTail // 생략 부호(...)가 꼬리에 위치하도록 설정
return l
}()

Expand Down Expand Up @@ -248,10 +248,10 @@ class WineOrderViewController: UIViewController {
view.addSubview(name)
name.snp.makeConstraints { make in
make.top.equalTo(image.snp.top)
make.leading.equalTo(image.snp.trailing).offset(15)
// make.trailing.equalTo(view.safeAreaLayoutGuide).offset(15)
make.leading.equalTo(image.snp.trailing).offset(13)
make.trailing.equalTo(stick.snp.trailing).offset(-5)
make.height.lessThanOrEqualTo(60)
make.width.lessThanOrEqualTo(250)
// make.width.lessThanOrEqualTo(250)
}

// view.addSubview(scoreLabel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class WineStoreListViewController: UIViewController {
l1.text = "Loxton"
l1.font = .boldSystemFont(ofSize: 18)
l1.textColor = .black
l1.numberOfLines = 0
l1.adjustsFontSizeToFitWidth = true // 텍스트가 레이블 너비에 맞도록 크기 조정
l1.numberOfLines = 2
l1.lineBreakMode = .byTruncatingTail // 생략 부호(...)가 꼬리에 위치하도록 설정
return l1
}()

Expand Down Expand Up @@ -142,21 +142,22 @@ class WineStoreListViewController: UIViewController {
make.leading.equalToSuperview().offset(12)
make.width.equalTo(imageView.snp.height)
}


wineInfo.addSubview(score)
score.snp.makeConstraints { make in
make.top.equalTo(imageView.snp.top)
make.trailing.equalToSuperview().inset(15)
}

wineInfo.addSubview(name)
name.snp.makeConstraints { make in
make.top.equalTo(imageView.snp.top)
make.leading.equalTo(imageView.snp.trailing).offset(13)
make.width.lessThanOrEqualTo(205)
make.trailing.equalTo(score.snp.leading).offset(-10)
// make.width.lessThanOrEqualTo(205)
make.height.lessThanOrEqualTo(55)
}

wineInfo.addSubview(score)
score.snp.makeConstraints { make in
make.top.equalTo(name.snp.top)
make.trailing.equalToSuperview().inset(15)
}

customPickerButton.setupPickerView(pickerView, toolbar: toolbar, pickerData: pickerData)
view.addSubview(customPickerButton)

Expand Down

0 comments on commit e3ff7fd

Please sign in to comment.