+(UIButton *)getBlueButtonWithTitle:(NSString *)aTitle{
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//要使用系统的变灰,只需设置BackgroundImage即可
[button setBackgroundImage:[UIImage imageNamed:@"blue.png"] forState:UIControlStateNormal];
[button setTitle:aTitle forState:UIControlStateNormal];
//变化后标题的颜色设置需设置状态为UIControlStateHighlighted
[button setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted];
button.layer.cornerRadius = 5;
button.layer.masksToBounds = YES;
return button;
}
 
04-28 12:22