Adnan Majeed
Adnan Majeed

Reputation: 151

UITextField placeholder changes when using dark theme

When using the Dark appearance, placeholder color of UITextField becomes lighter and becomes unreadable.

Same showed up for UILabel when using the default color for the label but once I've changed to Black color, it shows properly.

Upvotes: 5

Views: 2807

Answers (2)

Daniel Storm
Daniel Storm

Reputation: 18878

If you want to force a light theme only on your UITextField, instead of your entire app, theres a property for that:

myTextField.overrideUserInterfaceStyle = .light

Upvotes: 5

Zahid Nazir
Zahid Nazir

Reputation: 136

In your info.plist, set a new key ‘UIUserInterfaceStyle’ with value as ‘Light’.

After setting that, even in dark mode no font color will be changed

Upvotes: 8

Related Questions