【问题标题】:How to increase the image twice with the animation?如何使用动画将图像增加两倍?
【发布时间】:2015-09-05 15:58:20
【问题描述】:

我想移动图像并同时增加两次。但是如何放大图像,将其原始尺寸指定为 100%?我尝试执行以下操作,但它不起作用:

<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator">
    <scale
        android:duration="300"
        android:fillAfter="true"
        android:fromXScale="100%p"
        android:fromYScale="100%p"
        android:toXScale="150%p"
        android:toYScale="150%p" />
    <translate
        android:duration="500"
        android:fillAfter="true"
        android:fromYDelta="0"
        android:toYDelta="-100" />
</set>

谢谢。

【问题讨论】:

  • 你能再解释一下你的问题吗?您说您想移动图像并同时将其大小增加到两倍。现在你的问题是什么?您是否在代码中加载了该动画?
  • @HusseinElFeky 是的,我已经在代码中实现了它。总之,我想达到这个结果:s3.postimg.org/odge92qcj/1441469931951.jpg

标签: android android-animation android-xml


【解决方案1】:

试试这个:

<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:fillAfter="true">
    <scale
        android:duration="300"
        android:fromXScale="100%"
        android:fromYScale="100%"
        android:toXScale="150%"
        android:toYScale="150%"
        android:pivotX="50%"
        android:pivotY="50%" />
    <translate
        android:duration="500"
        android:fromYDelta="0"
        android:toYDelta="-100" />
</set>

这应该可以正常工作。确保在代码中加载它。

【讨论】:

    猜你喜欢
    • 2015-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-31
    • 2011-04-06
    • 2013-07-03
    • 2019-09-28
    • 1970-01-01
    相关资源
    最近更新 更多