android添加一层半透明,android – 在imageview上添加半透明叠加层

像这样设置你的imageview ::

android:id="@+id/imageview"

android:layout_width="wrap_parent"

android:layout_height="wrap_parent"

android:foreground="@drawable/image_overlay"

android:src="@drawable/your_image" />

image_overlay.xml

android:startColor="#401C87C0"

android:centerColor="#401C87C0"

android:endColor="#401C87C0"

/>

我使用color-code =#1C87C0并将其设置为25%不透明度,因此最终的颜色代码类似于#401C87C0.您可以根据您的要求更改颜色不透明度,更改颜色定义中的前2个字符::

100% — FF

99% — FC

98% — FA

97% — F7

96% — F5

95% — F2

94% — F0

93% — ED

92% — EB

91% — E8

90% — E6

89% — E3

88% — E0

87% — DE

86% — DB

85% — D9

84% — D6

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值