Changing tab bar font in Swift

后端 未结 7 1109
南方客
南方客 2020-12-16 10:03

I have been trying to change the font for the tab bar items however I haven\'t been able to find any Swift examples. I know that this is how you change it in Objective-C:

7条回答
  •  旧巷少年郎
    2020-12-16 10:53

    Swift 4.2

        UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont(name: "BahijTheSansArabic-Plain", size: 10)!], for: .normal)
        UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont(name: "BahijTheSansArabic-Plain", size: 10)!], for: .selected)
    

提交回复
热议问题