मैं एक ImageView का 2 सेकंड का एनीमेशन रखना चाहता हूं जो 1000ms को लुप्त होने में खर्च करता है और फिर 1000ms को लुप्त होती है।
यहाँ मैं अपने ImageView निर्माता में अब तक क्या है:
Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setDuration(1000);
Animation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setStartOffset(1000);
fadeOut.setDuration(1000);
AnimationSet animation = new AnimationSet(true);
animation.addAnimation(fadeIn);
animation.addAnimation(fadeOut);
this.setAnimation(animation);
जब मैं उस एनीमेशन को चलाता हूं, तो कुछ भी नहीं दिखता है। हालांकि, जब मैं अल्फा एनिमेशन में से एक को हटाता हूं, तो व्यवहार अपेक्षित रूप से काम करता है।
चीजें जो मैंने पहले ही आज़मा ली हैं:
- के , और
setFillBefore, के हर बोधगम्य संयोजन ।setFillAftersetFillEnabled LinearInterpolatorकरने के लिए एक जोड़नेAnimationSet।