首先创建一个模糊效果

let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)

接着创建一个承载模糊效果的视图
let blurView = UIVisualEffectView(effect: blurEffect)

设置视图的大小

blurView.frame.size = CGSize(width: view.frame.width, height: view.frame.height)

给控件添加模糊视图
bg.addSubview(blurView)

相关文章:

  • 2022-12-23
  • 2021-12-01
  • 2021-12-03
  • 2021-12-30
  • 2022-12-23
  • 2021-08-26
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2021-11-16
  • 2022-01-27
  • 2022-12-23
相关资源
相似解决方案