+(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;
}
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2022-01-22
  • 2021-08-18
  • 2021-06-05
  • 2021-12-31
相关资源
相似解决方案