Changing tab bar font in Swift

后端 未结 7 1111
南方客
南方客 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:49

    Put this under didFinishLaunchingWithOptions:

    UITabBarItem.appearance()
        .setTitleTextAttributes(
            [NSAttributedStringKey.font: UIFont(name: "Didot", size: 10)!], 
        for: .normal)
    

    This works in Swift 4

提交回复
热议问题