Self.tabBar.tintColor = Uicolor.orangecolor ()
Text color Restore
Uitabbaritem.appearance (). Settitletextattributes (
[NSForegroundColorAttributeName:self.view.tintColor], forstate:. Selected)
3, when selected, when not selected, use a different picture
The default label is selected, not selected are used by the same picture, but the color is different. We can also use two different pictures to represent both states.
Qq.tabbaritem = Uitabbaritem (title: "QQ", Image:uiimage (named: "QQ"),
Selectedimage:uiimage (named: "Qq_active"))
Android.tabbaritem = Uitabbaritem (title: "Android", Image:uiimage (named: "Android"),
Selectedimage:uiimage (named: "Android_active"))
4, use the original color of the picture
Default no matter what the original color, the renderer will render to a single color, although in line with the current trend of flattening, but sometimes we still want to use the image as it was.
The following example, when the label is selected, use the original picture that is not shaded (not selected still render to gray, of course, you can use the original picture)
Qq.tabbaritem = Uitabbaritem (title: "QQ", Image:uiimage (named: "Qq_color"),
&nbs P; selectedimage:uiimage (named: "Qq_color")? Imagewithrenderingmode (. alwaysoriginal))
Android.tabbaritem = uitabbaritem (title: "Android", Image:uiimage (named: " Android_color "),
selectedimage:uiimage (named:" Android_color ")? Imagewithrenderingmode (. alwaysoriginal))