利用NSMutableAttributedString实现
UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
button.frame = CGRectMake(100, 100, 100, 30);
button.backgroundColor = [UIColor redColor];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"压缩图片"];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:NSMakeRange(0, 2)];
[button setAttributedTitle:str forState:(UIControlStateNormal)];
NSMutableAttributedString *str1 = [[NSMutableAttributedString alloc] initWithString:@"压缩图片"];
[str1 addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(0, 2)];
[button setAttributedTitle:str1 forState:(UIControlStateHighlighted)];
[self.view addSubview:button];