我对 Droid 还很陌生,我一直在绞尽脑汁想弄清楚如何创建这个动画循环,我希望它看起来像这样......
我一直在尝试创建 3 个背靠背的平移动画,它们会不断地向右滑动。我可以让第一个 imageview 像我想要的那样制作动画,但是我很难为我的代码添加什么来让其他动画也能在它后面制作动画
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView image1 = (ImageView) findViewById(R.id.nescontroller);
ImageView image2 = (ImageView) findViewById(R.id.segacontroller);
ImageView image3 = (ImageView) findViewById(R.id.pscontroller);
TranslateAnimation anim1 = new TranslateAnimation(0, 500, 0, 0);
anim1.setDuration(2000);
anim1.setRepeatCount(Animation.INFINITE);
image1.startAnimation(anim1);
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/ee"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/e" />
<ImageView
android:id="@+id/dd"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/d" />
<ImageView
android:id="@+id/pscontroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/c" />
<ImageView
android:id="@+id/segacontroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/b" />
<ImageView
android:id="@+id/nescontroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/a" />
</RelativeLayout>
任何帮助或建议将不胜感激