Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CurrencyTextField ignores RoundedBorderTextFieldStyle #14

Open
PlasmaSoftUK opened this issue Sep 27, 2020 · 1 comment
Open

CurrencyTextField ignores RoundedBorderTextFieldStyle #14

PlasmaSoftUK opened this issue Sep 27, 2020 · 1 comment

Comments

@PlasmaSoftUK
Copy link

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

@youjinp
Copy link
Owner

youjinp commented Sep 28, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants