0

Does anyone has problems with the UIBlurEffect on iOS10 ? For some Reason the background of my button etc just gets a bit transparent and doesn't blurr anymore....

    let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.ExtraLight)
    blurBackgroundView = UIVisualEffectView(effect: blurEffect)
    blurBackgroundView.frame = frame
    button = UIButton(frame: frame)   
    blurBackgroundView.layer.masksToBounds = true
    backgroundColor = UIColor.clearColor()
    addSubview(blurBackgroundView)
    addSubview(button)

that's how the code looks....

If I change UIBlurEffectStyle.ExtraLight to UIBlurEffectStyle.Prominent based on the new documentation the Button is just clear... so no color at all!

1 Answers1

0

Add whatever you want not to be blurred to your blurBackgroundView. So instead of:

addSubview(blurBackgroundView)
addSubview(button)

You'll have to:

blurBackgroundView.addSubview(button)
addSubview(blurBackgroundView)

Now every item in the current view, below your blurBackgroundView will get blurred, while your button will stay as it is.

ezcoding
  • 2,974
  • 3
  • 23
  • 32