全局更改所有UIButtons背景颜色的最佳方法是什么?我已经全局设置了色调
[[UIApplication sharedApplication] delegate].window.tintColor =
答案 0 :(得分:4)
[[UIButton appearance] setBackgroundImage:[UIImage imageNamed:@"button.png"]
forState:UIControlStateNormal];
或者
[[UIButton appearance] setBackgroundColor:[UIColor purpleColor]];
以下是有关外观代理的更多信息:http://developer.apple.com/library/ios/documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html
答案 1 :(得分:0)
检查出来:
[[UIButton appearance] setBackgroundColor:[UIColor redColor]];