ryan ryan - 4 months ago 7
Android Question

How to change background color in android app

I want to be able to change the background color to white in my android app in the simplest way possible.

Answer

You need to use the android:background property , eg

android:background="@color/white"

Also you need to add a value for white in the strings.xml

<color name="white">#FFFFFF</color>

Edit : 18th Nov 2012

The first two letters of an 8 letter color code provide the alpha value, if you are using the html 6 letter color notation the color is opaque.

Eg :

enter image description here

Comments