Remove alpha from UIAlertView in iOS 8
I would like to make the alert view in my application solid white, not translucent white. Since UIAlertView extends UIView, I've tried the following:
alert.backgroundColor = [UIColor whiteColor];
alert.alpha = 1;
alert.opaque = YES;
but the warning continues to be transparent. How can I make it a solid white background?
+3
source to share
2 answers
If you want to get alerts with a solid white background without transparency, you can do this:
UIVisualEffectView.appearance(whenContainedInInstancesOf: [UIAlertController.classForCoder() as! UIAppearanceContainer.Type]).backgroundColor = UIColor.white
it works for both UIAlertController and UIAlertView.
0
source to share