@IBOutlet weak var bg: UIImageView!
@IBOutlet weak var logo: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view,typically from a nib.
logo.layer.cornerRadius=70;
logo.clipsToBounds=true;
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)
}
代码下载地址http://download.csdn.net/detail/bianhuanshizhe/8651677
原文链接:https://www.f2er.com/swift/327229.html