iOS 修改UIAlertController的按钮字体颜色
2016-12-06 18:11
435 查看
UIAlertController *alert = [UIAlertControlleralertControllerWithTitle:@"确定要删除这个作品吗?"message:nilpreferredStyle:UIAlertControllerStyleAlert];
//修改按钮的颜色
UIAlertAction *sure = [UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction
*_Nonnull action) {
}];
[sure setValue:[UIColorredColor]
forKey:@"_titleTextColor"];
UIAlertAction *cancle = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction
*_Nonnull action) {
}];
[cancle setValue:[UIColorredColor]
forKey:@"_titleTextColor"];
[alert addAction:sure];
[alert addAction:cancle];
[selfpresentViewController:alertanimated:truecompletion:nil];
效果图:
//修改按钮的颜色
UIAlertAction *sure = [UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction
*_Nonnull action) {
}];
[sure setValue:[UIColorredColor]
forKey:@"_titleTextColor"];
UIAlertAction *cancle = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction
*_Nonnull action) {
}];
[cancle setValue:[UIColorredColor]
forKey:@"_titleTextColor"];
[alert addAction:sure];
[alert addAction:cancle];
[selfpresentViewController:alertanimated:truecompletion:nil];
效果图:
相关文章推荐
- IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容
- iOS:如何修改导航栏按钮或者字体的颜色
- iOS UIAlertController上修改标题(title) 消息(message) 按钮 的字体大小及颜色
- IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容
- iOS中修改头部tabBarButton 默认按钮的颜色和默认字体颜色
- ios自定义导航navigation,设置navigation的背景图,navigation左边按钮,以及navigation字体颜色
- iOS 修改SearchBar的Textfiled的Cursor游标颜色和字体样式和大小;Disable输入框
- IOS修改titleView的字体颜色
- ios开发修改textfiled的placeholder的字体的大小和颜色
- 修改ios中statusbar字体颜色
- iOS 修改textField的placeholder的字体颜色
- iOS 中修改导航默认标题颜色、字体
- IOS修改TABBAR字体大小和选中颜色
- 修改 UIImagePickerController 选择照片状态栏颜色及导航栏按钮标题字体颜色
- ios7 修改ios状态栏默认字体颜色
- ios 修改UITabBarItem字体颜色,正常与选中状态
- ios修改textField的placeholder的字体颜色、大小
- iOS 修改textField的placeholder的字体颜色、大小
- ios修改textField的placeholder的字体颜色、大小
- iOS修改UITextField的提示语(placeholder)的字体大小和颜色