NSString*str =@"你的手机xxx还未绑定,只有绑定才能进行相关操作,是否绑定";
NSString*title =@"提示";
UIAlertController*alertC= [UIAlertControlleralertControllerWithTitle:titlemessage:strpreferredStyle:UIAlertControllerStyleAlert];
//修改title
NSMutableAttributedString*alertControllerStr = [[NSMutableAttributedStringalloc] initWithString:title];
[alertControllerStraddAttribute:NSForegroundColorAttributeNamevalue:[UIColorredColor]range:NSMakeRange(0,2)];
[alertControllerStraddAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:17]range:NSMakeRange(0,2)];
[alertCsetValue:alertControllerStrforKey:@"attributedTitle"];
//改变alert提示内容的字体和颜色
NSMutableAttributedString*alertControllerMessageStr = [[NSMutableAttributedStringalloc] initWithString:str];
[alertControllerMessageStraddAttribute:NSForegroundColorAttributeNamevalue:[UIColorgreenColor]range:NSMakeRange(0,20)];
[alertControllerMessageStraddAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:15]range:NSMakeRange(0,20)];
[alertCsetValue:alertControllerMessageStrforKey:@"attributedMessage"];
UIAlertAction*cancel = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction*_Nonnullaction) {
}];
//改变按钮的颜色
[cancelsetValue:[UIColorcolorWithRed:24/255.0green:242/255.0blue:207/255.0alpha:1]forKey:@"titleTextColor"];
[alertCaddAction:cancel];
UIAlertAction*yes = [UIAlertActionactionWithTitle:@"确认"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction*_Nonnullaction) {
}];
[yessetValue:[UIColorcolorWithRed:24/255.0green:242/255.0blue:207/255.0alpha:1]forKey:@"titleTextColor"];
[alertCaddAction:yes];
[selfpresentViewController:alertCanimated:YEScompletion:nil];