I add a tab bar in storyboard, and do not want to set an image to the tab bar item, and like the following:
How can I change the font and the position for the title of the bar item in storybord?
I add a tab bar in storyboard, and do not want to set an image to the tab bar item, and like the following:
How can I change the font and the position for the title of the bar item in storybord?
First select the tab bar item in storyboard, than in Attributes Inspector set System Item and Title Position to Custom, so you will be able to change the position of the title by setting values to Horizontal and Vertical boxes.
Finally, to change the font, in your viewDidLoad()
, include:
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont(name: "Avenir-BlackOblique", size:20)!, NSForegroundColorAttributeName: UIColor.blue], for: .normal)
NSFontAttributeName
allow you to change the font style and NSForegroundColorAttributeName
allow you to change the font color.
© 2022 - 2024 — McMap. All rights reserved.