我正在尝试重新创建 iOS 11 控制中心视图。我还没有尝试使其功能化,但我正在尝试获得相同的样式,但我无法确定它在 iOS 11 中的外观。我该怎么做?这是迄今为止我想要的,当然没有模糊视图上的按钮。有小费吗?谢谢。
import UIKit
import PlaygroundSupport
let view = UIImageView(image: #imageLiteral(resourceName: "IMG_5413.PNG"))
view.backgroundColor = .white
view.frame = CGRect(x: 0, y: 0, width: 350, height: 650)
let light = UIBlurEffect(style: .light)
let lightView = UIVisualEffectView(effect: light)
lightView.layer.masksToBounds = true
lightView.frame = view.frame
lightView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(lightView)
let dark = UIBlurEffect(style: .dark)
let darkView = UIVisualEffectView(effect: dark)
darkView.layer.cornerRadius = 50
darkView.layer.masksToBounds = true
darkView.frame = CGRect(x: 50, y: 50, width: 250, height: 250)
darkView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(darkView)
PlaygroundPage.current.liveView = view