Why does the background of the TextField remain white after I've set it to use a defined colour? Why does it still overlay white?
import SwiftUI
struct ContentView: View {
@State var search: String = ""
var body: some View {
ZStack{
Color.baseColour
.edgesIgnoringSafeArea(.all)
VStack(alignment: .center, spacing: 0) {
HStack(alignment: .center, spacing: 0) {
TextField("Search for a profile... ", text: $search)
.textFieldStyle(RoundedBorderTextFieldStyle())
.cornerRadius(15)
.background(Color.textFieldBarColour)
}
.frame(width: UIScreen.main.bounds.width - 30)
.background(Color.textFieldBarColour)}