SwiftUI - 如何模糊视图的默认背景颜色?

SwiftUI - How can I blur the default background color of a view?

这里没有要显示的代码,但我想知道如何才能做到这一点。我试过使用

.blur(radius: (20)

在一个视图上,但它往往会模糊整个视图。包括文本,以及视图中的任何其他内容。默认背景颜色很好,我没有 want/need 更改它(为了使应用程序与 light/dark 模式兼容)。我想让视图的背景略微 blurred/opaque,但我希望视图中的文本和按钮仍然保持完整和正常。有什么方法可以模糊视图本身的背景颜色吗?

可以仅将模糊直接应用于背景,如下例所示

Button("Test") {}
        .background(Color.red.blur(radius: 20))