• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps text color and size coding

pathanos

Newbie
I am trying to figure out how to change the color text in my app. Default is white, not so good with a white background. Any help would be great.
 
In your layout XML, you can specify the attribute android:textColor="@color/whatever_color" for the TextView element.

In order to do this, however, you need to create a colors.xml file in your res/values folder and create a color element. Something like this:
Code:
<color name="red">#FF0000</color>

The "@color/xxx" part in the TextView attribute would be referenced using the string given to the name attribute in your color definition. So with the example I gave, you would use:
Code:
android:textColor="@color/red"
 
Ok, that worked for the text. But how would I adjust the spinner text color? Maybe I'm not seeing my mistake in the code.
 
Spinner text color? You mean in the collapsed spinner or in the dialog that is presented when the user clicks the spinner?
 
All of the above actually. I wanted a white background, so i need some other color for all texts. Its a going to be a basic app with no fancy stuff. There will be no need for that.
 
Back
Top Bottom