【问题标题】:Android ImageView Animation: moving an ImageView over other views depending on their positionAndroid ImageView 动画:根据位置将 ImageView 移动到其他视图上
【发布时间】:2016-02-04 14:57:32
【问题描述】:

我需要用于动画的 Java (Android) 代码将 ImageView3 从 ImageView1 动画(移动)到 Imageview2。我需要 ImageView3 的中心与 ImageView1 在开始时的中心相匹配,而 ImageView3 的中心在动画结束时与 ImageView2 的中心相匹配。我做了一个gif 来展示我到底想要实现什么

【问题讨论】:

    标签: android android-layout android-animation


    【解决方案1】:

    将此代码复制粘贴到您的动画文件中。根据需要调整百分比。

    <?xml version="1.0" encoding="utf-8"?>
    <translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="0"
    android:toYDelta="80%"
    android:fromXDelta="0"
    android:toXDelta="80%"
    >
    </translate>
    

    【讨论】:

      猜你喜欢
      • 2013-09-22
      • 1970-01-01
      • 2014-06-21
      • 2011-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-17
      • 2017-08-29
      相关资源
      最近更新 更多