SwiftUI - Customize TextField Border with border Modifier

From PeformIQ Upgrade
Revision as of 08:35, 31 July 2024 by PeterHarding (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Customize TextField Border with border Modifier

struct ContentView: View {
    @State private var text = ""

    var body: some View {
        TextField("Enter text", text: $text)
            .padding(10)
            .border(Color.blue, width: 2)
            .padding()
    }
}