Set Color In Xml Using android.R.color

April 22, 2018

Use @android:color/*.

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello"
    android:textColor="@android:color/white" />

Full list of available color for android.R.color

Below is a list of some useful color.

  • black
  • white
  • red
  • transparent
  • lighter_gray
  • darker_gray
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.