Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify an RGB-format color using XML on Android [closed]

Please give an example of specifying an RGB-formatted color using XML on Android. The syntax is #rrggbb.

like image 494
user1673627 Avatar asked Oct 22 '12 04:10

user1673627


1 Answers

You can specify an RGB-formatted color in XML like this:

<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="Test text"
            android:textColor="#332116"
            android:textSize="16sp"
            android:textStyle="bold" />

General form:

android:textColor="#332116" is "#rrggbb"
like image 75
Nikhil Avatar answered Oct 15 '22 00:10

Nikhil