r/iosapps•
Ilsomm097

Glass effect modifier bug?

Question

Hey everyone, I'm playing around with the glassEffect modifier in SwiftUI and I think I've run into some kind of visual bug. Is anyone else experiencing the same thing?

As soon as a container has multiple children and padding is applied to the children, this visual bug appears.

This is the code that produces the wrong effect:

VStack {
    Text("Wrong effect")
        .font(.title)
        .fontWeight(.semibold)
        .padding()
    Text("Padding applied to both text in the VStack")
        .foregroundStyle(.secondary)
        .font(.subheadline)
        .padding()
}
.glassEffect(in: .rect(cornerRadius: 16))

For reference, this is the code producing the correct behaviour when padding is applied to the container instead:

VStack {
    Text("Correct effect with no padding")
}
.padding()
.frame(minWidth: 300)
.glassEffect(in: .rect(cornerRadius: 12))

https://preview.redd.it/ncpjgloeeedf1.png?width=586&format=png&auto=webp&s=e045f9af5351bc17b101109578ed0f3bda1eb0a8

Posted Jul 17, 2025, 8:49 AM UTC

10
Loading comments…