1

I was looking at the following Stackoverflow post in a attempt to change my layout's background color. It said to go add a new color in the "colors.xml" file located at res\values\colors.xml I went to that directory but there was no colors.xml file. Where can I find the colors.xml file?

3 Answers 3

1

right click on res->values folder and make a new file named colors.xml and define your color as following in colors.xml:

<?xml version="1.0" encoding="utf-8"?> <resources> <color name="white">#FFFFFF</color> <color name="yellow">#FFFF00</color> </resources> 

Simple as that.

Sign up to request clarification or add additional context in comments.

Comments

0

You have to make one of your own. There is no colors.xml initially.

3 Comments

Depends on ide. Android studio creates it initially
I'm using Android studio and it did not create it initially.
I think it might create it if you choose some special template. Otherwise you should make it yourself.
0

If your Android project lacks a colors.xml file, you can create a new file at:

res\values\ 

Name the new file colors.xml and populate it as needed for your purposes.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.