改变提示框文字颜色
NSString*title =@"重要提示??";
//改变 UIAlertController 标题颜色NSMutableAttributedString*str = [[NSMutableAttributedStringalloc]initWithString:title];
[str addAttribute:NSForegroundColorAttributeNamevalue:[UIColorcolorwithHexString:@"#00A0E9"] range:NSMakeRange(0,6)];
NSString*message = [NSStringstringWithFormat:@"删除之后不可恢复\n哈哈哈"];
NSString*cancelButtonTitle =NSLocalizedString(@"确定",nil);
NSString*otherButtonTitle =NSLocalizedString(@"取消",nil);
UIAlertController*alertController = [UIAlertControlleralertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
//改变 UIAlertController 按钮颜色##整个应用层级修改,即修改了整个应用的渲染色,一定要用的话,结束时要改回原来的值[UIViewappearance].tintColor = [UIColorcolorwithHexString:@"#00A0E9"];
//点击事件UIAlertAction*cancelAction = [UIAlertActionactionWithTitle:cancelButtonTitle style:UIAlertActionStyleCancelhandler:^(UIAlertAction*action) {NSLog(@"234");
}];
UIAlertAction*otherAction = [UIAlertActionactionWithTitle:otherButtonTitle style:UIAlertActionStyleDefaulthandler:^(UIAlertAction*action) {
}];
[alertController setValue:str forKey:@"attributedTitle"];
// Add the actions.[alertController addAction:cancelAction];
[alertController addAction:otherAction];
【改变提示框文字颜色】[selfpresentViewController:alertController animated:YEScompletion:nil];
推荐阅读
- 2018-02-06第三天|2018-02-06第三天 不能再了,反思到位就差改变
- android第三方框架(五)ButterKnife
- 标签、语法规范、内联框架、超链接、CSS的编写位置、CSS语法、开发工具、块和内联、常用选择器、后代元素选择器、伪类、伪元素。
- 改变自己,先从自我反思开始
- 如何在Mac中的文件选择框中打开系统隐藏文件夹
- 越努力越幸福
- #微习惯可以改变你#第2周复盘
- 呼市首大医院温馨提示(男人有啥也不能有“qian”)
- 如何启动改变
- 改变没有对错