android怎么样对我的目标点移动许多图像我的、图像、目标、android

由网友(流年゛染指了青春)分享简介:如何实现与Android源$ C ​​$ C我的想法how to implement my idea with android source code我有很多的形象,我想通过一个移动图像之一,如果在目标点图片的运动,那么其他的图像上移动图像背后previous。i have many image, i want...

如何实现与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..

希望这将帮助你。

阅读全文

相关推荐

最新文章