Reputation: 1552
EDIT: My line in AndroidManifest was wrong. It should have been
android:theme="@style/CustomTheme"
Now all the text color has changed. Not the button color but I am on my way. Thanks for the help.
This must be an easy answer but I keep getting errors. I am, as far as I can tell, following the Android documentation HERE but it doesn't work. I have read many stactoverflow threads on this issue and trying to follow what seemed like the best one. The goal is to change the text color globally in an already complete project.
This is in res/values/styles.xml
<resources>
<style name="style_name" parent="@android:style/Theme.Black">
<item name="android:textColor">#00FF00</item>
</style>
</resources>
I reference it in AndoridMinafest.xml
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/style_name"
>
What I am trying to do is keep the basic style of Theme.Black but change the text color.
What am I doing wrong? The line android:theme="@android:style/style_name" in AndroidManifest generates an error which then errors out every class.
Upvotes: 3
Views: 4972
Reputation: 1552
I was close, just a typo but as I was unable to find an answer to this on the web and found lots of people asking I thought I would document exactly what ended up working. This did not work for the cases where I had hard coded a color but I would not expect that to happen. This did change all the default text colors.
AndroidManifest was modified like this:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomTheme"
>
And the file res/values/styles.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomTheme" parent="android:Theme.Black">
<item name="android:textColor">#ffff00</item>
</style>
</resources>
And this works. All the text is yellow -- except the text defined as
android:textColor="@android:color/white"
And that is another story. I will have to edit each instance to change that.
Upvotes: 3