如何使用对象动画从中心位置旋转imageview

时间:2013-12-16 10:55:31

标签: android android-layout

I am doing same as this link

这工作正常,但我想在移动图像时移动其他图像 像这样

i want to move left side image attach with above image

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="86dp"
    android:src="@drawable/top_pati" />
<ImageView
    android:id="@+id/imageView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/imageView1"
    android:layout_below="@+id/imageView1"
    android:src="@drawable/top_pativertical" />
<ImageView
    android:id="@+id/imageView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignRight="@+id/imageView1"
    android:layout_below="@+id/imageView1"
    android:src="@drawable/top_pativertical" />

1 个答案:

答案 0 :(得分:0)

尝试使用此代码进行对象动画:

ObjectAnimator anim = ObjectAnimator.ofFloat(tvBorder, View.ROTATION, 60);
anim.setRepeatMode(ValueAnimator.REVERSE);
anim.start();