I would like to keep the border at the bottom part only in UITextField.
But I don\'t know how we can keep it on the bottom side.
Can you please advise m
In SwiftUI, The simplest implementation would be,
struct MyTextField: View {
var myPlaceHolder: String
@Binding var text: String
var underColor: Color
var height: CGFloat
var body: some View {
VStack {
TextField(self.myPlaceHolder, text: $text)
.padding(.horizontal, 24)
.font(.title)
Rectangle().frame(height: self.height)
.padding(.horizontal, 24).foregroundColor(self.underColor)
}
}
}
Usage:
MyTextField(myPlaceHolder: "PlaceHolder", text: self.$text, underColor: .red, height: 3)