可以用到简单的xml的背景框
<!--白色透明度--> <color name="translucent_white_05">#f2ffffff</color> <color name="translucent_white_10">#e6ffffff</color> <color name="translucent_white_15">#d9ffffff</color> <color name="translucent_white_20">#ccffffff</color> <color name="translucent_white_25">#bfffffff</color> <color name="translucent_white_30">#b3ffffff</color> <color name="translucent_white_35">#a6ffffff</color> <color name="translucent_white_40">#99ffffff</color> <color name="translucent_white_45">#8cffffff</color> <color name="translucent_white_50">#80ffffff</color> <color name="translucent_white_55">#73ffffff</color> <color name="translucent_white_60">#66ffffff</color> <color name="translucent_white_65">#59ffffff</color> <color name="translucent_white_70">#4dffffff</color> <color name="translucent_white_75">#40ffffff</color> <color name="translucent_white_80">#33ffffff</color> <color name="translucent_white_90">#26ffffff</color> <color name="translucent_white_95">#0dffffff</color>
<!--黑色透明度--> <color name="translucent_black_05">#f2000000</color> <color name="translucent_black_10">#e6000000</color> <color name="translucent_black_15">#d9000000</color> <color name="translucent_black_20">#cc000000</color> <color name="translucent_black_25">#bf000000</color> <color name="translucent_black_30">#b3000000</color> <color name="translucent_black_35">#a6000000</color> <color name="translucent_black_40">#99000000</color> <color name="translucent_black_45">#8c000000</color> <color name="translucent_black_50">#80000000</color> <color name="translucent_black_55">#73000000</color> <color name="translucent_black_60">#66000000</color> <color name="translucent_black_65">#59000000</color> <color name="translucent_black_70">#4d000000</color> <color name="translucent_black_75">#40000000</color> <color name="translucent_black_80">#33000000</color> <color name="translucent_black_90">#26000000</color> <color name="translucent_black_95">#0d000000</color> </resources>
半透明值:
不透明 | 100% | FF |
95% | F2 | |
90% | E6 | |
85% | D9 | |
80% | CC | |
75% | BF | |
70% | B3 | |
65% | A6 | |
60% | 99 | |
55% | 8C | |
半透明 | 50% | 80 |
45% | 73 | |
40% | 66 | |
35% | 59 | |
30% | 4D | |
25% | 40 | |
20% | 33 | |
15% | 26 | |
10% | 1A | |
5% | 0D | |
全透明 | 0% | 00 |