繁体   English   中英

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

[英]how to rotate imageview from its centre position using object animation

我正在做与此链接相同

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

我想移动左侧图像并附上上面的图像

<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" />

尝试使用以下代码进行对象动画处理:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM