2

这就是我定义的方式UIVisualEffectView

    UIApplication.sharedApplication().delegate?.window??.addSubview(self)

    let blurEffect = UIBlurEffect(style: .Light)
    let blurEffectView = UIVisualEffectView(effect: blurEffect)
    blurEffectView.frame = CGRectMake(20, 30, 300, 50)
    blurEffectView.backgroundColor = UIColor.yellowColor()
    addSubview(blurEffectView)

但这是一个结果:

在此处输入图像描述

但是正如你所看到的,navigationBar 的标题一点也不模糊。怎么了?

4

1 回答 1

0

superviewofblurEffectView必须有:

alpha = 1
backgroundColor = UIColor.clearColor()
于 2015-09-28T14:41:22.737 回答