UItabbarViewController取消默认蓝色与设置标题颜色

代码如下

    var textAttrs:Dictionary<String,AnyObject> = Dictionary()
    textAttrs[NSForegroundColorAttributeName] = AppMacros.RGBACOLOR(123.0, g: 123.0, b: 123.0, a: 1.0)
    var selectedTextAttrs:Dictionary<String,AnyObject> = Dictionary()
    selectedTextAttrs[NSForegroundColorAttributeName] = UIColor.orangeColor()
    
    let vc1 = UIViewController()
    vc1.tabBarItem.title = "首页"
    vc1.tabBarItem.image = UIImage(named: "tabbar_home")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
    vc1.tabBarItem.setTitleTextAttributes(textAttrs, forState: UIControlState.Normal)
    vc1.tabBarItem.setTitleTextAttributes(selectedTextAttrs, forState: UIControlState.Highlighted)
    vc1.tabBarItem.selectedImage = UIImage(named: "tabbar_home_selected")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)

你可能感兴趣的:(UItabbarViewController取消默认蓝色与设置标题颜色)