1
UINavigationBar.apperance()。titleTextAttributes不起作用。 Swift代码如下。UINavigationBar.apperance()。titleTextAttributes在swift中不起作用
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
UINavigationBar.appearance().translucent = false
UINavigationBar.appearance().barTintColor = UIColor.greenColor()
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:UIColor.whiteColor()]
return true
}
任何想法?
这是否帮助? http://stackoverflow.com/a/18937321/646960 –
让属性:字典= [NSFontAttributeName:UIFont.systemFontOfSize(19.0),NSForegroundColorAttributeName:UIColor.whiteColor()]。 UIBarButtonItem.appearance()setTitleTextAttributes(属性,forState :UIControlState.Normal) – SARANGA
@LoïsDiQual谢谢 – SARANGA