0
我很難嘗試更改我的UITabBarItem
的圖標顏色。我用下面的代碼初始化所有參數:更改UITabBarItem圖像的顏色
// Settings Tab
tabBarController?.tabBar.translucent = false
tabBarController?.tabBar.barTintColor = dark_color
let titoli:[String] = ["Feed","Categorie","Info"]
for (var i:Int=0; i<titoli.count; i++){
let tab:UITabBarItem? = tabBarController?.tabBar.items![i] as UITabBarItem?
tab?.image = UIImage(named: titoli[i])
tab?.title = titoli[i]
tab?.setTitleTextAttributes(NSDictionary(object: UIColor.whiteColor(), forKey: NSForegroundColorAttributeName) as? [String:AnyObject], forState: UIControlState.Selected)
tab?.setTitleTextAttributes(NSDictionary(object: UIColor(red: 0, green: 0, blue: 0, alpha: 0.6), forKey: NSForegroundColorAttributeName) as? [String:AnyObject], forState: UIControlState.Normal)
}
我在這裏丟失了什麼嗎? FYI:只是的XCode測試版和雨燕2.0
會發生什麼?出了什麼問題? – vrwim