rams rams - 25 days ago 6x
Android Question

how to change the alpha value of imageview

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


But it is not working.

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


Maybe you can try like this, I had troubles doing it normal way but with "animation" it was ok.

AlphaAnimation alpha = new AlphaAnimation(0.5F, 0.5F); // change values as you want
alpha.setDuration(0); // Make animation instant
alpha.setFillAfter(true); // Tell it to persist after the animation ends
// And then on your imageview