android - Android动画成功完成图
问题描述
我有一个图像视图,其中有 3 个图像
- green_circle - 我必须放大 -> 然后 zoom_out (在指定时间)
- white_tick - 我必须放大 -> 然后 zoom_out (在指定时间)
- green_sparkle - 放大和淡出
Imageview 正在使用图层可绘制对象设置如下 -
int[] firstImageArray = new int[]{R.drawable.ic_green_circle, R.drawable.ic_outer_sparkle, R.drawable.ic_white_tick_mark};
Drawable[] layers = new Drawable[firstImageArray.length];
for(int i = 0; i<firstImageArray.length; i++) {
layers[i] = getResources().getDrawable(firstImageArray[i]);
}
imageView.setImageDrawable(new LayerDrawable(layers));
动画文件与此类似(用于在指定时间放大和缩小): R.anim.image_circle_zoom :
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="2333"
>
<scale
android:duration="233"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" />
<scale
android:duration="69"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="1931"
android:toXScale="1.18"
android:toYScale="1.18" />
<scale
android:duration="165"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="2000"
android:toXScale="0.0"
android:toYScale="0.0" />
</set>
我已经尝试过 AnimationSet、AnimatorSet 和 ObjectAnimator,但我无法达到预期的效果。任何帮助将不胜感激如何实现?
解决方案
推荐阅读
- python - ValueError:使用数据张量作为模型的输入时
- spring-cloud-stream - Spring Cloud Stream Kafka 异常处理
- javascript - 方向改变时如何更新反应滑动器?
- spring - 将 jooq 记录数据映射到多个 pojo
- mongodb - Spring Data MongoDB - 有没有办法有一个隐式时间戳?
- python - 无论如何在Firefox上制作没有无头模式的硒?
- python - 子进程不在 python cgi 脚本中运行
- url-rewriting - 如何在没有 .html 地址的情况下打开我的页面?
- ruby-on-rails - link_to delete 方法将我带到 Rails 上的“显示”页面
- github - 在 GitHub 上发布 windows 可执行文件