ojnab
October 23, 2019, 2:54pm
1
On native textfields and boxes the color of placeholders are hardcoded in corona core:
[super setText:\_placeholder]; [self setTextColor:[UIColor lightGrayColor]]; \_showingPlaceholder = true;
In my app I use black text on white backgrounds, so when switching to dark mode the placeholders can’t be seen because the text color is the same as the background color. (I do not intend to create a full dark mode version of the app)
Please fix it. Thanks.
rob
October 23, 2019, 11:26pm
2
Consider making a pull request with a suggested fix. I’ll ask engineering, but I can’t confirm when we can get to it.
Rob
ojnab
October 24, 2019, 11:52am
3
I can do a pull request for iOS with a new textField:setPlaceholderTextColor() call but I suspect you would want this to work on all supported platforms?
Would you accept a pull with stubs for the other platforms?
vlads
October 24, 2019, 11:26pm
4
I was thinking on fixing the issue tomorrow. Probably I will make that default colors are different when in dark mode.
If it won’t work out very well, I’ll add setPlaceholderTextColor.
ojnab
October 25, 2019, 11:27am
5
Great thanks vlads.
You might wan’t to look into the default text color for the textfields too.
If text color is not set with setTextColor then it uses a system color that are also changed when iOS is in dark mode.
This can result in text being “invisible” because it has the same color as the background.
ojnab
October 25, 2019, 12:32pm
6
I just discovered that it is possible to add this to the plist settings in the build.settings:
UIUserInterfaceStyle = "light",
This forces the app to use light mode.
If we rebuild our apps with that everything will work as before.
Maybe you should do a blog post warning about this, because dark mode messes with app builds already in the store.
vlads
October 25, 2019, 3:05pm
7
ojnab:
I just discovered that it is possible to add this to the plist settings in the build.settings:
UIUserInterfaceStyle = "light",
This forces the app to use light mode.
If we rebuild our apps with that everything will work as before.
Maybe you should do a blog post warning about this, because dark mode messes with app builds already in the store.
Thanks. This is great idea!
I also ‘fixed’ dark mode edit boxes, and added way to detect dark mode. Should be up in next release.
FYI, iTunes Connect will reject “light” as a key for UIUserInterfaceStyle. It must be “Light”. Apparently casing matters.
vlads
October 25, 2019, 11:22pm
9
Hey guys. So new build just went up. Please, feel freeto test. It contains both system.getInfo(‘darkMode’) and better defaults for color of text box.
https://developer.coronalabs.com/release/2019/3544/
Please make this work on Mac OS as well.
vlads
October 30, 2019, 10:41am
11
It seems the new Dark Mode setting
UIUserInterfaceStyle = "Light",
does not work on Mac OS (in macos.plist in build.settings)
vlads
October 30, 2019, 4:06pm
13
Oh. Sorry, that is what you mean. Yes, UIUserInterfaceStyle is iOS only. UIKit is unavailable on macOS.
Mac OS entry should be NSRequiresAquaSystemAppearance = true
This will force app to light mode (aka “aqua” on macOS)
rob
October 30, 2019, 10:02pm
15
I’ve updated the blog post to clarify the plist settings.
Rob