我正在使用以下代码创建模糊背景视图:
struct Blur: UIViewRepresentable {
let style: UIBlurEffect.Style = .systemUltraThinMaterial
func makeUIView(context: Context) -> UIVisualEffectView {
return UIVisualEffectView(effect: UIBlurEffect(style: style))
}
func updateUIView(_ uiView: UIVisualEffectView, context: Context) {
uiView.effect = UIBlurEffect(style: style)
}
}
然而,这段代码返回一个具有背景模糊效果的普通矩形。我该如何使其变成圆角矩形?