问题
I am using a picker on my application of type time picker. The picker works fine on iOS devices, however when I go to the android application, it appears, but the font color is white, and cant see the numbers.
I do not want to change the background to a darker color because it doesnt match the rest of the application and wont be matching the ios app. I was wondering if there is a way to change just the font to black or gray color.
I have already tried some of the solutions posted, and changing the themes, but it has not worked out for me.
回答1:
You need to create custom theme
<resources>
<style name="Theme.NoActionBar" parent="@style/Theme.AppCompat.Light"> </style>
</resources>
Put this code in /platform/android/res/values/custom_theme.xml
回答2:
To fix the solution to this, you can add the following in your Theme.xml file under platform/android/values.
You can visit this link for my post on the appcelerator developer forum where I had raised this issue.
http://developer.appcelerator.com/question/182115/picker-font-color-on-android
Now you can apply the theme attribute to the window that you are planning on using your picker in, and applying the Light or LightDarkBar theme. This will turn the color your picker font to black.
You can format the code in the editor after pasting it. You can do that by pressing command shift F on mac, and for windows I am sure its control shift F, but not 100% on that.
来源:https://stackoverflow.com/questions/29832782/changing-android-picker-font-color-on-titanium-appcelerator