Skip to content

Commit

Permalink
[CHORE] Button 영역 44px로 수정 (Team-LionHeart#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffalswo2 committed Jul 21, 2023
1 parent 1fcc051 commit 28e7065
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension UIButton {

extension UIButton {
func marginImageWithText(margin: CGFloat) {
let halfSize = margin/2
let halfSize = margin / 2
imageEdgeInsets = UIEdgeInsets(top: 0, left: -halfSize, bottom: 0, right: halfSize)
titleEdgeInsets = UIEdgeInsets(top: 0, left: halfSize, bottom: 0, right: -halfSize)
contentEdgeInsets = UIEdgeInsets(top: 0, left: halfSize, bottom: 0, right: halfSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ final class LHNavigationBarView: UIView {
private let leftBarItem: UIButton = {
let button = UIButton()
button.tintColor = .designSystem(.white)
button.marginImageWithText(margin: 14)
return button
}()

private let rightFirstBarItem: UIButton = {
let button = UIButton()
button.setImage(ImageLiterals.NavigationBar.bookMark, for: .normal)
button.tintColor = .designSystem(.white)
button.marginImageWithText(margin: 14)
return button
}()

private let rightSecondBarItem: UIButton = {
let button = UIButton()
button.setImage(ImageLiterals.NavigationBar.profile, for: .normal)
button.tintColor = .designSystem(.white)
button.marginImageWithText(margin: 14)
return button
}()

Expand All @@ -49,7 +52,6 @@ final class LHNavigationBarView: UIView {
rightFirstBarItem, rightSecondBarItem
])
stackView.axis = .horizontal
stackView.spacing = 8
stackView.alignment = .center
stackView.distribution = .equalSpacing
stackView.isHidden = true
Expand Down Expand Up @@ -110,7 +112,7 @@ final class LHNavigationBarView: UIView {

rightBarItemsStackView.snp.makeConstraints { make in
make.centerY.equalTo(leftBarItem)
make.trailing.equalToSuperview().inset(24)
make.trailing.equalToSuperview().inset(16)
}

graySepartorLine.snp.makeConstraints { make in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ final class CurriculumTableViewCell: UITableViewCell, TableViewCellRegisterDeque

lazy var curriculumToggleDirectionButton: UIButton = {
var button = UIButton()
button.marginImageWithText(margin: 19)
button.setImage(ImageLiterals.Curriculum.arrowDownSmall, for: .normal)
button.setImage(ImageLiterals.Curriculum.arrowUpSmall, for: .selected)
button.setContentCompressionResistancePriority(.required, for: .horizontal)
Expand Down Expand Up @@ -166,7 +167,7 @@ private extension CurriculumTableViewCell {
curriculumToggleDirectionButton.snp.makeConstraints{
$0.leading.greaterThanOrEqualTo(weekTitleLabel.snp.trailing).offset(8)
$0.centerY.equalTo(weekLabel)
$0.trailing.equalToSuperview()
$0.trailing.equalToSuperview().offset(12)
}

curriculumWholeStackView.snp.makeConstraints{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ final class CurriculumUserInfoView: UIView {
let label = UILabel()
label.font = .pretendard(.head3)
label.textColor = .designSystem(.gray100)
label.textAlignment = .center
return label
}()

Expand All @@ -67,13 +68,8 @@ final class CurriculumUserInfoView: UIView {
}

override func layoutSubviews() {
// MARK: - 컴포넌트 설정
setUI()

// MARK: - addsubView
setHierarchy()

// MARK: - autolayout설정
setLayout()
}

Expand All @@ -91,6 +87,7 @@ extension CurriculumUserInfoView {

func setHierarchy() {
self.addSubviews(userWeekDayInfoView, weekImageView, userWeekLabel, weekLabel, dayImageView, userDayLabel, dayLabel)
dayImageView.addSubview(userDayLabel)
}

func setLayout() {
Expand All @@ -116,8 +113,7 @@ extension CurriculumUserInfoView {
}

userDayLabel.snp.makeConstraints{
$0.leading.equalTo(dayImageView.snp.leading).offset(4)
$0.centerY.equalTo(dayImageView)
$0.center.equalToSuperview()
}

dayLabel.snp.makeConstraints{
Expand Down

0 comments on commit 28e7065

Please sign in to comment.