Sheet background color looks perfectly fine(sheet background color sets system background color automatically)
Untill presented view has .white background color, then sheet background color becomes white instead of default background color.
(sheet background color becomes same as presented view's bgcolor { which is white } and one can't differentiate between sheet and presented view bgcolor)
Screenshot For customTextView(backColor: .yellow.opacity(0.5)) { Observe Sheet BGColor }
Screenshot For customTextView(backColor: .white) { Sheet BGColor beomes white }
This is Sheet Code
struct customTextView: View {
@State var backColor: Color
var body: some View {
Text("This is SHEET !")
.font(.largeTitle)
.padding()
.background(backColor)
}
}
How i present that sheet is shown below in code
.sheet(isPresented: $open, content: {
customTextView(backColor: .white)
.frame(width: 300, height: 300)
})
Before macOS 13.3
For macOS 13.3+