格式如#00FFFFFF,前两位代表不透明度的十六进制。00表示完全透明,FF就是全不透明。依次递增。
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <color name="transparent">#00000000</color> <!-- 透明 -->
- <color name="translucent">#e0000000</color> <!-- 半透明 -->
- <color name="transparency_100">#ff000000</color>
- <color name="transparency_95">#f2000000</color>
- <color name="transparency_90">#e6000000</color>
- <color name="transparency_85">#d9000000</color>
- <color name="transparency_80">#cc000000</color>
- <color name="transparency_75">#bf000000</color>
- <color name="transparency_70">#b3000000</color>
- <color name="transparency_65">#a6000000</color>
- <color name="transparency_60">#99000000</color>
- <color name="transparency_55">#8c000000</color>
- <color name="transparency_50">#80000000</color>
- <color name="transparency_45">#73000000</color>
- <color name="transparency_40">#66000000</color>
- <color name="transparency_35">#59000000</color>
- <color name="transparency_30">#4d000000</color>
- <color name="transparency_25">#40000000</color>
- <color name="transparency_20">#33000000</color>
- <color name="transparency_15">#26000000</color>
- <color name="transparency_10">#1a000000</color>
- <color name="transparency_5">#0d000000</color>
- <color name="transparency_0">#00000000</color>
- </resources>
将其放在color.xml文件中,以后直接使用
时间: 2024-10-31 20:20:25