How to avoid a blink in Translate animation for Android?
I have a image at position 0,0 initially. When the user clicks a button I animate the image and move it to 0,100 using
Animation an = new TranslateAnimation(0, 0, 0, listInstanceDetails.DragItemHeight); an.setFillAfter(true);
Since the setFillAfter is true. The animation stays at 0,100. Now the user clicks the button again and I want it to come back from 0,100 to 0,0. So I use the code
Animation an = new TranslateAnimati开发者_如何转开发on(0, 0, 100, 0); an.setFillAfter(true);
This is working fine. But when just before the second animation starts from 100,0 It gives a blink at 0,0 and then starts from 100,0 to 0,0. This looks very ugly.
Is there a way to avoid this blink. Is there anyone who has played around a lot with Translate animation and done a similar operation. Am I doing something wrong. Please let me know your inputs. Thank you for your time and advice.
I had used an.setFillBefore(false); in my code. I removed it and it started working fine.
精彩评论