开发者

how to move image using android

开发者 https://www.devze.com 2023-03-20 06:41 出处:网络
I am working on a project in android.In this project i have to move an image from one place to other.i did it using translateanimation.But it is not moving smoothly.Can anyone suggest usi开发者_如何学

I am working on a project in android.In this project i have to move an image from one place to other.i did it using translateanimation.But it is not moving smoothly.Can anyone suggest usi开发者_如何学JAVAng opengl?


You can move an image smoothly with translateanimation by using setDuration().

try this code

TranslateAnimation anim = new TranslateAnimation(xFrom,xTo,yFrom,yTo);
anim.setDuration(2000);
image.setAnimation(anim); 


if your intantion is to move the image as per touch then there is no need to use opengl

plse refer this question which is shown how to move the image using touch click here

0

精彩评论

暂无评论...
验证码 换一张
取 消