java - image is snapping back to old location, translate, android, xml -
what trying animate image current position new 1 following
xml
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate xmlns:android ="http://schemas.android.com/apk/res/android" android:fromxdelta ="0" android:toxdelta ="0" android:fromydelta ="0" android:toydelta ="-100" android:duration ="2000" android:fillafter ="true" /> </set>
java code
imageview logo01 = (imageview) findviewbyid(r.id.logo01); animation animation01 = animationutils.loadanimation(this, r.anim.translate); animation01.reset(); logo01.clearanimation(); logo01.startanimation(animation01);
however, @ end of animation, image snapping old postion. how can avoid situation @ end, image @ new position.
i once had similar issue. ended using dynamic animation instead of xml:
translateanimation anim = new translateanimation(0,0,0,-100); anim.setduration(2000); anim.setfillafter(true); logo01.setanimation(anim);
Comments
Post a Comment