【发布时间】:2013-02-06 07:26:09
【问题描述】:
在我的 Android 应用中,我有一个缩放动画。
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:fillEnabled="true" android:fillAfter="true" >
<scale android:fromXScale="1.0" android:toXScale="0.0" android:fromYScale="1.0" android:toYScale="1.0" android:duration="32000" />
</set>
它工作正常。它从左到右缩放视图。但我需要从右到左缩放。所以当我修改fromXScale="-1.0" 时,动画不会发生,视图会立即缩放而没有动画。
我的反向动画xml如下:
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:fillEnabled="true" android:fillAfter="true" >
<scale android:fromXScale="-1.0" android:toXScale="0.0" android:fromYScale="1.0" android:toYScale="1.0" android:duration="32000" />
</set>
如何从相反方向为视图设置动画?我的代码有什么问题?
【问题讨论】:
标签: android xml scale android-animation