How to adjust ImageView transparency

My image is set to 50% transparent. When I put it in ImageView, it is completely opaque, cannot see things behind. How can I set the XML for ImageView to be 100% transparent so that when I set the image I can see things behind. I have tried

android:opacity="translucent" android:background="@android:color/transparent" 

They both do not work.

+4
source share
1 answer

Try using the alpha transparency attribute:

http://developer.android.com/reference/android/view/View.html#attr_android:alpha

 android:alpha="0.5" 

Gives 50% alpha transparency for View .

+7
source

Source: https://habr.com/ru/post/1488935/


All Articles