开发者

how to move image using android

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜