PWD-1: add border to text field style
This commit is contained in:
parent
a4dce65275
commit
63d2c9e6eb
1 changed files with 7 additions and 1 deletions
|
@ -11,12 +11,18 @@ struct PwdTextFieldStyle: TextFieldStyle {
|
|||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
private let radius: CGFloat = 12
|
||||
|
||||
func _body(configuration: TextField<Self._Label>) -> some View {
|
||||
configuration
|
||||
.padding(EdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8))
|
||||
.background(colorScheme == .dark ? .black : .white)
|
||||
.foregroundColor(colorScheme == .dark ? .white : .black)
|
||||
.textFieldStyle(.plain)
|
||||
.cornerRadius(12)
|
||||
.cornerRadius(radius)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: radius)
|
||||
.stroke(.gray, lineWidth: 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue