Set Color In Xml Using android.R.color

Apr 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

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.