Change TabBarItem title font to bold in Swift for iOS

前端 未结 6 703
执念已碎
执念已碎 2020-12-18 05:08

I\'m trying to set the font weight of a selected tab bar item to bold font. It seems as it has no effect. Any idea what is wrong. forState: .Normal works as exp

6条回答
  •  忘掉有多难
    2020-12-18 05:59

    UITabBarItem.appearance().setTitleTextAttributes(
            [NSFontAttributeName: UIFont(name:"your_font_name", size:11)!, 
                NSForegroundColorAttributeName: UIColor(rgb: 0x929292)], 
            forState: .Normal)
    

提交回复
热议问题