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:
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.