如何在Android上使用XML指定RGB格式颜色

前端之家收集整理的这篇文章主要介绍了如何在Android上使用XML指定RGB格式颜色前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
请举例说明在 Android上使用XML指定RGB格式的颜色.语法是#rrggbb.

解决方法

您可以在XML中指定RGB格式的颜色,如下所示: @H_301_6@<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" />

一般形式:

@H_301_6@android:textColor="#332116" is "#rrggbb"

猜你在找的Android相关文章