m1entus / UIAlertController-MZStyle

Category for UIAlertController customization
MIT License
94 stars 21 forks source link

The background color of UIAlertActionStyleCancel type cannot be modified #6

Open TomWang1 opened 3 years ago

TomWang1 commented 3 years ago

The background color of UIAlertActionStyleCancel type cannot be modified

MZAlertControllerStyle *defaultStyle = [UIAlertController mz_sharedStyle];
defaultStyle.blurEffectStyle = UIBlurEffectStyleDark;
defaultStyle.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
defaultStyle.actionSheetCancelButtonBackgroundColor = [UIColor redColor];
defaultStyle.shouldApplyBlur = YES;
[defaultStyle setActionSheetCancelButtonConfigurationHandler:^(UIAlertAction *action, UILabel *label, UIView *backgroundView) {
    backgroundView.backgroundColor = [UIColor greenColor];
}];