SwiftUI - Customize TextField Border with border Modifier

From PeformIQ Upgrade
Revision as of 08:34, 31 July 2024 by PeterHarding (talk | contribs) (Created page with " =Customize TextField Border with border Modifier= <pre> struct ContentView: View { @State private var text = "" var body: some View { TextField("Enter text", text: $text) .padding(10) .border(Color.blue, width: 2) .padding() } } </pre> Category:SwiftUI")
(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()
    }
}