So the button stackview is having a blur & transparent view on top of another ImageView. How can I make this work? I've tried the blur effectview and visual effectview but all failed on fulfill this design. I also try to usign the CIFilter to blur the background image of the StackView but still not the same one.
Answer for the comment, code for blur effectveiw and visual view. see below image for the real result.
let test: UIView = {
let test = UIView()
test.backgroundColor = .clear
return test
}()
let blurEffect = UIBlurEffect(style: .extraLight)
let blurView = UIVisualEffectView(effect: blurEffect)
blurView.translatesAutoresizingMaskIntoConstraints = false
pictureImageView.insertSubview(blurView, at: 0)
blurView.snp.makeConstraints { (make) in
make.centerX.equalTo(view)
make.top.equalTo(view).offset(450)
make.width.equalTo(169)
make.height.equalTo(48)
}
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
let vibrancyView = UIVisualEffectView(effect: vibrancyEffect)
vibrancyView.translatesAutoresizingMaskIntoConstraints = false
vibrancyView.contentView.addSubview(test)
blurView.contentView.addSubview(vibrancyView)
vibrancyView.snp.makeConstraints { (make) in
make.centerX.equalTo(view)
make.top.equalTo(view).offset(450)
make.width.equalTo(169)
make.height.equalTo(48)
}
Update, after add the alpha @Narjes mentioned below, the only code added is the blurView.alpha = 0.3
, and the result is here, seems missing the blur effect.