android如何在我的目标点上移动许多图像
如何用android源代码实现我的想法 我有很多图像,我想一个接一个地移动图像,若图像在目标点移动,那个么另一个图像在前一个图像的后面移动 插图android如何在我的目标点上移动许多图像,android,Android,如何用android源代码实现我的想法 我有很多图像,我想一个接一个地移动图像,若图像在目标点移动,那个么另一个图像在前一个图像的后面移动 插图 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" image1,image2,image3 x (point destination move) """""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
image1,image2,image3 x (point destination move)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
如果图像3移动
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
image1,image2 image3 x
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
如果图像2移动,则图像3跟随移动图像2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
image1 image2,image3 x
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
等等
如何实现android的源代码
我是新手
感谢移动对象,在android中,我们有一个称为TranslateAnimation的概念。 以下是将我的对象从左向右移动的示例片段:
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);
然后,您可以对三张图像应用相同的技巧
希望这能帮助您..对于移动对象,在android中,我们有一个称为TranslateAnimation的概念。 以下是将我的对象从左向右移动的示例片段:
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);
然后,您可以对三张图像应用相同的技巧
希望这将对你有所帮助。Ii它对你的问题有帮助,使之成为正确答案或投票结果。。这将对面临相同问题的人有所帮助。。嗯,,,,,,你的答案很有帮助,你的答案是使用按钮,我想使用幻灯片使用手指拖动和使用surfaceview,,,,你可以再次帮助我吗?我想创建像abacus这样的简单应用程序:)Ii它对你的问题很有帮助,使之成为正确答案或投票结果..这将有助于面对同一问题的人..嗯,,,,,,你的答案很有帮助,你的答案是使用按钮,我想使用滑梯使用手指拖动和使用surfaceview,,,,你能再次帮助我吗?我想创建像abacus这样的简单应用程序:)