简体   繁体   English

如何将这种效果放在Android中的imageview上

[英]How to put this effect on an imageview in android

I'm using Glide for loading an image by an url and I want to reproduce the same effect on my imageview. 我正在使用Glide通过URL加载图像,并且希望在imageview上重现相同的效果。 How can I put this effect on an imageview like this one? 如何将这种效果放在像这样的imageview上?

Goutham制作的电视系列Android应用UI
(source: cloudfront.net ) (来源: cloudfront.net

imageView.setImageAlpha()应该可以工作。该方法的取值范围是0到255,其中0是完全透明的,而255是完全不透明的。

Also, you can set the opacity for your ImageView in your XML file with alpha attribute: 另外,您可以使用alpha属性为XML文件中的ImageView设置不透明度:

android:alpha="0.0" fully invisible

android:alpha="0.5" half invisible/half visible

android:alpha="1.0" fully visible

you can also set numbers like 0.56565 for better precision of the desired opacity. 您还可以设置数字0.56565,以提高所需不透明度的精度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM