Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix [#24] tabbar 기기대응 #30

Merged
merged 4 commits into from
Jan 8, 2024
Merged

Fix [#24] tabbar 기기대응 #30

merged 4 commits into from
Jan 8, 2024

Conversation

boyeon0119
Copy link
Contributor

👾 작업 내용

  • SE 기기대응과 아이콘 삽입을 했습니다.

🚀 PR Point

SE 사이즈 예외처리

  • tabbarController와 tabView의 사이즈를 UIScreen.main.isLongerThan812pt를 이용해 SE 사이즈는 따로 레이아웃을 잡아줬습니다.

  • tabbarController의 높이 코드입니다.

if UIScreen.main.isLongerThan812pt {
            let tabBarHeight: CGFloat = 52.0.adjusted
            tabBar.frame.size.height = tabBarHeight + safeAreaHeight
            tabBar.frame.origin.y = view.frame.height - tabBarHeight - safeAreaHeight
        } else {
            let tabBarHeight: CGFloat = 58.0.adjusted
            tabBar.frame.size.height = tabBarHeight + safeAreaHeight
            tabBar.frame.origin.y = view.frame.height - tabBarHeight - safeAreaHeight
        }
  • 탭바 아이콘과 타이틀 간격입니다.
if UIScreen.main.isLongerThan812pt {
                tabBarItem.tabBarItem.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -3.adjusted)
            } else {
                tabBarItem.tabBarItem.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -1.adjusted)
            }
  • tabBarView의 높이입니다.
tabBarView.snp.makeConstraints {
            $0.bottom.equalToSuperview()
            $0.horizontalEdges.equalToSuperview()
            
            if UIScreen.main.isLongerThan812pt {
                $0.height.equalTo(100.adjusted)
            } else {
                $0.height.equalTo(64)
            }
        }

📸 스크린샷

구현 내용 스크린샷
SE사이즈와 13mini사이즈 비교

✅ Issue

Resolved #24

@boyeon0119 boyeon0119 added 🙊보연 보연의 issue 🐞fix 오류 고치는 것 / 수정용 labels Jan 8, 2024
@boyeon0119 boyeon0119 added this to the 🚀1차 스프린트🚀 milestone Jan 8, 2024
@boyeon0119 boyeon0119 self-assigned this Jan 8, 2024
Copy link
Member

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!!!! 😎

let tabBarHeight: CGFloat = 58.0
tabBar.frame.size.height = tabBarHeight + safeAreaHeight
tabBar.frame.origin.y = view.frame.height - tabBarHeight - safeAreaHeight
let safeAreaHeight = view.safeAreaInsets.bottom.adjustedHeight
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3. 이부분 삼항연산자로 간결하게 할 수 있을듯합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옼에이~

Comment on lines 42 to 50
$0.horizontalEdges.equalToSuperview()
$0.height.equalTo(100)

if UIScreen.main.isLongerThan812pt {
$0.height.equalTo(100.adjusted)
} else {
$0.height.equalTo(64)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5. 혹시 height만 adjusted 뺀 이유가 있을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이상해집니다. ㅋ

Comment on lines -62 to -63
let safeAreaHeight = view.safeAreaInsets.bottom
let tabBarHeight: CGFloat = 58.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4. adjusted height 가능할 것 같기도 합니다!

Comment on lines 69 to 73
let tabBarHeight: CGFloat = 52.0.adjusted
tabBar.frame.size.height = tabBarHeight + safeAreaHeight
tabBar.frame.origin.y = view.frame.height - tabBarHeight - safeAreaHeight
} else {
let tabBarHeight: CGFloat = 58.0.adjusted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5. adjustedHeight하면 좋습니다!

@boyeon0119 boyeon0119 merged commit 4a843ab into develop Jan 8, 2024
@boyeon0119 boyeon0119 changed the title Fix[#24] tabbar 기기대응 Fix [#24] tabbar 기기대응 Jan 12, 2024
@Zoe0929 Zoe0929 deleted the fix/#24-Tabbar branch June 12, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞fix 오류 고치는 것 / 수정용 🙊보연 보연의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Fix] 탭바 기기대응 레이아웃 수정
3 participants