Custom TabBarController 만들기
2021. 7. 20. 01:51ㆍ아이폰 개발
크게 손대지 않고 커스텀 탭바를 만들고 싶을때 도움이 된다.
https://stackoverflow.com/questions/59091488/swift-custom-tabbar-with-center-rounded-button
https://betterprogramming.pub/how-to-create-a-custom-tabbar-in-swift-d44b3db3ac0e
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if tabBarTag == true {
self.tabBarController?.tabBar.tintColor = UIColor.red
} else {
self.tabBarController?.tabBar.tintColor = UIColor.blue
}
}
https://developer.apple.com/forums/thread/98947
extension UITabBar {
override public func sizeThatFits(size: CGSize) -> CGSize {
super.sizeThatFits(size)
var sizeThatFits = super.sizeThatFits(size)
sizeThatFits.height = 71 // or whatever height you need
return sizeThatFits
}
}
https://stackoverflow.com/questions/23044218/change-uitabbar-height