android怎么样对我的目标点移动许多图像 [英] android how to moving many image on my destination point

查看:154
本文介绍了android怎么样对我的目标点移动许多图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何实现与Android源$ C ​​$ C我的想法

how to implement my idea with android source code

我有很多的形象,我想通过一个移动图像之一,如果在目标点图片的运动,那么其他的图像上移动图像背后previous。

i have many image, i want to move image one by one, if image move on destination point, then other image moving on behind image previous.

ilustration

ilustration

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

image1,image2,image3                           x (point destination move)

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

如果移动的Image3

if image3 move

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
image1,image2                           image3 x

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

如果IMAGE2然后移动的Image3跟着移动IMAGE2

if image2 move then image3 follow move image2

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
image1                           image2,image3 x

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

如何实现源$ C ​​$ C的android

how to implementation to source code android

我是新手

感谢

推荐答案

有关移动的物体,在android系统,我们有一个名为TranslateAnimation概念。
这里是我的移动物体从左至右的示例代码段:

For moving objects, in android we have a concept called TranslateAnimation. Here is the sample snippet for moving my object from left to right:

ll = new LinearLayout(this);
ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
ll.setOrientation(LinearLayout.VERTICAL);

tv = new TextView(this);
tv.setText("Animation");

moveLefttoRight = new TranslateAnimation(0, 200, 0, 0);
moveLefttoRight.setDuration(1000);
moveLefttoRight.setFillAfter(true);

button = new Button(this);
button.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
button.setText("PressMe");
button.setOnClickListener(new OnClickListener() {

    public void onClick(View v) {
        tv.startAnimation(moveLefttoRight);
    }

});

ll.addView(tv);
ll.addView(button);
setContentView(ll);

然后,您可以使用同样的伎俩,以你的三幅图像。

Then, you can apply the same trick to your three images..

希望这将帮助你。

这篇关于android怎么样对我的目标点移动许多图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆