设置类的所有实例的外观

要自定义类的所有实例的外观,请访问所需类的外观代理。例如:

设置 UIButton 色调

迅速:

 placeholderCopyUIButton.appearance().tintColor = UIColor.greenColor()

Objective-C 的:

 placeholderCopy[UIButton appearance].tintColor = [UIColor greenColor];

设置 UIButton 背景颜色

迅速:

 placeholderCopyUIButton.appearance().backgroundColor = UIColor.blueColor()

Objective-C 的:

 placeholderCopy[UIButton appearance].backgroundColor = [UIColor blueColor];

设置 UILabel 文本颜色

迅速:

 placeholderCopyUILabel.appearance().textColor = UIColor.redColor()

Objective-C 的:

 placeholderCopy[UILabel appearance].textColor = [UIColor redColor];

设置 UILabel 背景颜色

迅速:

 placeholderCopyUILabel.appearance().backgroundColor = UIColor.greenColor()

Objective-C 的:

 placeholderCopy[UILabel appearance].backgroundColor = [UIColor greenColor];

设置 UINavigationBar 色彩

迅速:

 placeholderCopyUINavigationBar.appearance().tintColor = UIColor.cyanColor()

Objective-C 的:

 placeholderCopy[UINavigationBar appearance].tintColor = [UIColor cyanColor];

设置 UINavigationBar 背景颜色

迅速:

 placeholderCopyUINavigationBar.appearance().backgroundColor = UIColor.redColor()

Objective-C 的:

 placeholderCopy[UINavigationBar appearance].backgroundColor = [UIColor redColor];