I have an image that disappears as soon as the page loads. However, the final alpha of the image set in the animation is not saved. I have the following (simple) xml for my image:
<ImageView android:id="@+id/myImage" android:layout_width="match_parent" android:layout_height="match_parent" android:cropToPadding="true" android:scaleType="centerCrop" android:background="#ffffff" />
Then I have an animation file that disappears in the image:
<set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromAlpha="0.0" android:toAlpha="0.6" android:duration="2000"/> </set>
Then, finally, the code that loads the image:
body =(ImageView)findViewById(R.id.myImage); body.setBackgroundDrawable(new BitmapDrawable(this.getResources(), background)); Animation myFadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.fadein_bg); body.startAnimation(myFadeInAnimation);
So, how can I get the latest alpha image to stay after the animation is complete?
thanks
source share