0

I'm trying to fade my image alpha from 1 to 0 by 2000ms but it seems like it goes rather quickly like half a second. Here's my code:

ImageView tom = (ImageView) findViewById(R.id.imgJerry);

    tom.animate().alpha(0f).setDuration(2000);

I'm following a lesson from Udemy and they got it work fine.

GTHell
  • 603
  • 1
  • 8
  • 20

2 Answers2

0

You should use Animation on it. Declare the animation in xml and its duration and then refer this in to Code.Yes previous answer is correct.. How to do a fadein of an image on an Android Activity screen?

Community
  • 1
  • 1
Sardar Khan
  • 845
  • 6
  • 16
0

For those who also face the same problem make sure that you turn on Animation in the developer setting in your android phone.

I've been turn it off for a while and just turn it back to 1x or 0.5x is enough.

GTHell
  • 603
  • 1
  • 8
  • 20