youjinp/SwiftUIKit

CurrencyTextField ignores RoundedBorderTextFieldStyle

Opened this issue · 1 comments

Sorry, me again, it seems that its not possible to apply this setting to the Currency Text Field:

.textFieldStyle(RoundedBorderTextFieldStyle())

When I add this option nothing about the text field appearance changes, it is in a view with other normal TextFields and so I would like it to be styled the same. I can get close to the effect I am wanting using this:

.foregroundColor(Color.black)
.background(Color.white)
.cornerRadius(12)

This gives a white background with black text and rounded corners, but just like a normal TextField when viewing in Dark Mode it's all black as it ignores the white background. So the above styling option would fix that but doesn't work.

Kind Regards

Plasma

That's right. CurrencyTextField is a wrapper around UITextField so it is not possible to apply SwiftUI's modifiers and extensions.

You can do this, however, to get the same effect

CurrencyTextField(..., foregroundColor: UIColor.black, ...)
    .background(Color.white)
    .cornerRadius(12)