How do I change the textColorPrimary in a theme?

喜你入骨 提交于 2019-12-04 03:13:12

Just as a workaround, Instead of using textAppearanceLarge in the layout, (if you're using xml to build the layout), define your own textAppearanceLarge style in the styles.xml that emulates the android default one except you can change the color to white.

xml layout:

<!-- example textview -->
<TextView style="@style/large" android:text="text goes here"></TextView>

then in the styles.xml

<style name="large">
    <item name="android:textColor">@android:color/white</item>
    <!-- other necessary items here like font etc.-->
</style>

The only difference between "style" and "theme" is the scope at which a style is applied at. A style applied to an Activity is called a Theme.

Here's a good writeup on the topic : http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/

Turns out I was barking up the wrong tree. Overriding the colors and everything worked just fine. However, by defining android:background in my theme, everything just completely messed up, and all text appeared white, despite me overriding all colors (including textColorPrimary). Omitting android:background did the trick.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!