Answers for "swiftui custom textfield"

1

add textfield in swiftui

struct ButtonAndTextFieldView : View {

    @State var text: String = ""

    var body: some View {
        HStack {
            TextField($text,
                      placeholder: Text("type something here..."))
            Button(action: {
                // Closure will be called once user taps your button
                print(self.$text)
            }) {
                Text("SEND")
            }
        }
    }
}
Posted by: Guest on March-13-2020
0

how to style textfield swiftui

TextField("Enter some text", text: $yourBindingHere)
    .textFieldStyle(RoundedBorderTextFieldStyle())
Posted by: Guest on March-27-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language