【问题标题】:Animation with Scale and bounce具有缩放和反弹的动画
【发布时间】:2018-10-28 22:43:43
【问题描述】:

我正在尝试将动画设置为:https://www.dropbox.com/s/ua2tj7jio64xap2/slideupanim.mov?dl=0

我使用下面的代码来创建上滑动画。结果我得到的是:https://www.dropbox.com/s/uggcktccjivlknk/device-2018-05-18-183937.mp4?dl=0

问题:它没有以一些额外的比例值弹跳。

<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
    android:duration="350"
    android:fillAfter="true"
    android:fromYDelta="100%"
    android:interpolator="@android:anim/bounce_interpolator"
    android:toYDelta="0%"/>

【问题讨论】:

    标签: android animation


    【解决方案1】:

    试试这个

        <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/bounce_interpolator">
        <translate
            android:duration="350"
            android:fillAfter="true"
            android:fromYDelta="100%"
    
            android:toYDelta="0%"/>
    </set>
    

    【讨论】:

      【解决方案2】:

      我已经通过以下代码解决了我的动画:

      <?xml version="1.0" encoding="utf-8"?>
      <set xmlns:android="http://schemas.android.com/apk/res/android"
          android:fillAfter="false"
          android:interpolator="@android:anim/bounce_interpolator">
      
          <scale
              android:duration="500"
              android:fromXScale="1.0"
              android:fromYScale="0.0"
              android:toXScale="1.0"
              android:toYScale="1.0" />
      
      </set>
      

      希望这对你有用。

      【讨论】:

        猜你喜欢
        • 2018-03-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-04-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多