Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the alpha value of imageview [duplicate]

In my app I want to change the ImageView like the following. I want only to change the image on the body.

enter image description here

I have followed the following link to change the alpha values by using the code like that

imageView.setAlpha(255);

But it is not working.

How to Set Opacity (Alpha) for View in Android. Please anybody suggest me how to do that.

like image 361
rams Avatar asked Jan 24 '26 21:01

rams


2 Answers

Or, without using animation you can just use setAlpha(float alpha) on your ImageView.

like image 189
Ovidiu Latcu Avatar answered Jan 27 '26 10:01

Ovidiu Latcu


It might be because setAlpha(float Alpha) has been deprecated as of API level 16 by setImageAlpha(float Alpha)

like image 37
7heViking Avatar answered Jan 27 '26 11:01

7heViking



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!