I am attempting to attain having a GlassEffectContainer with some buttons and the choose button has a crimson backside border.
My solely subject is that the glass impact is not being utilized on the background the place the border is added.
struct GroupedGlassBorder: View {
@State var chosen: Int = 1
var physique: some View {
GlassEffectContainer {
HStack {
BorderButton(title: "One", num: 1, chosen: $chosen)
BorderButton(title: "Two", num: 2, chosen: $chosen)
BorderButton(title: "Three", num: 3, chosen: $chosen)
}
}
.glassEffect()
}
}
struct BorderButton: View {
var title: String
var num: Int
@Binding var chosen: Int
var physique: some View {
Button {
self.chosen = num
} label: {
Textual content(title)
.padding(12)
}
.background(alignment: .backside) {
Capsule()
.body(peak: 2)
.foregroundStyle(chosen == num ? .crimson : .clear)
}
}
}


