Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Set ImageView transparent

Tags:

android

My image is set to 50% transparent. When I put it to ImageView, it is totally opaque, can't see the things behind. How can I set in xml for the ImageView 100% transparent, so that when I set the image, I can see the things behind. I tried

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

Both of them, don't work.

like image 997
batuman Avatar asked Feb 16 '23 01:02

batuman


1 Answers

Try using the alpha transparency attribute:

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

android:alpha="0.5"

Will give 50% alpha transparency to the View.

like image 110
Ken Wolf Avatar answered Feb 28 '23 10:02

Ken Wolf