in iOS 16 beta 4, the following code ignores the UITextView.appearance().backgroundColor = .clear
struct ContentView: View {
@State var text = "Type something here."
var body: some View {
ZStack {
Color.blue.ignoresSafeArea()
TextEditor(text: $text)
.frame(height: 100)
.padding([.leading, .trailing], 40)
}
.onAppear {
UITextView.appearance().backgroundColor = .clear
}
}
}
Earlier, I had assumed it was Xcode 14 beta 4 - but further investigation shows that it's the new iOS beta.
I would obviously prefer that TextEditor correctly handle it's own .background() method, but in the meantime, any ideas for a workaround?