draveness / NightNight

Elegant way to integrate night mode to swift projects
MIT License
775 stars 56 forks source link

How to modify tabbarItem text color #21

Open menicor opened 7 years ago

menicor commented 7 years ago

tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName:UIColor.black ,NSFontAttributeName:UIFont.systemFont(ofSize: 10)] , for: UIControlState())

atjiu commented 5 years ago

textColor

self.tabBar.tintColor = UIColor.red

backgroundColor

self.tabBar.mixedBarTintColor = MixedColor(normal: UIColor(CNodeColor.backgroundColor), night: UIColor(CNodeColor.backgroundColor_dark))
Lakr233 commented 5 years ago

` class YourTabBarClass: UITabBarController {

override func viewDidLoad() {
    super.viewDidLoad()

    tabBar.mixedBarTintColor = MixedColor(normal: 0xfbfbfb, night: 0x000000)
    tabBar.mixedTintColor = MixedColor(normal: 0x0AAADD, night: 0xffffff)

}

} `