If you need to amend the UITabBar in order to fit your layout or design perfectly, a common place to start is with the height.
A quick and simple way I have been able to change the height is to subclass the UITabBar and then override the sizeThatFits(size: CGSize) function.
If you are using Storyboards, you can then set the class of the Tab Bar using the Custom Class option.
Below is a code example of the subclass:
1 2 3 4 5 6 7 8 |
class CustomTabBar: UITabBar { override func sizeThatFits(size: CGSize) -> CGSize { var size = super.sizeThatFits(size) size.height = 88 return size } } |
Please follow and like us: