【问题标题】:Create custom blur UIView创建自定义模糊 UIView
【发布时间】:2016-08-14 14:30:32
【问题描述】:

我必须开发一个使用模糊视图的应用程序。

我曾尝试将UIVisualEffectViewUIBlueEffect 一起使用,但后来我意识到只有3 种模糊类型可供您选择,而没有自定义模糊的选项。

我需要制作介于 LightDark 模式之间的模糊,但我不知道如何创建自定义模糊视图。

知道我该怎么做吗?

谢谢!

【问题讨论】:

    标签: ios objective-c iphone swift cocoa-touch


    【解决方案1】:

    用户下面的模糊效果代码

    let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.dark)
    let blurEffectView = UIVisualEffectView(effect: blurEffect)
    blurEffectView.frame = view.bounds
    blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    view.addSubview(blurEffectView)
    

    你也可以使用下面的库

    https://github.com/ide/UIVisualEffects

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-25
      • 2020-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多