UIAlertViewController:取消和其他操作按钮的独立色调颜色

San*_* SS 3 objective-c ios uialertcontroller

是否可以为取消和其他操作按钮提供单独的色调颜色?目前我正在改变色调颜色controller.view.tintColor = [UIColor blackColor];

但它也改变了取消按钮的色调颜色.我需要设置不同的色调颜色,说红色到取消按钮.请帮帮我们.

bee*_*eee 9

在警报操作上设置颜色,如下所示:

UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel"....

[cancel setValue:[UIColor redColor] forKey:@"titleTextColor"];
Run Code Online (Sandbox Code Playgroud)

迅速:

let cancelAction: UIAlertAction = UIAlertAction(title: "Cancel", style: .cancel) 
cancelAction.setValue(UIColor.red, forKey: "titleTextColor")
Run Code Online (Sandbox Code Playgroud)