如何使用 jetpack compse 使 AnimatedImageVector 一次为单个路径制作动画?

问题描述 投票:0回答:1
android kotlin android-jetpack-compose android-vectordrawable
1个回答
0
投票

您只能为给定的

AnimatedImageVector
指定单个动画可绘制对象。
AnimatedImageVector
也只有一种动画状态,即
atEnd
。您可以,在每次单击时,切换
AnimatedImageVector
的可绘制对象,但您仍然只有一个状态对象,因此您将丢失其他圆圈的动画状态。

相反,我建议您为每个圆圈设置单独的

Image
。然后,您可以为每个图像提供自己的
AnimatedImageVector
,该图像将具有自己的
atEnd
状态。为此,您需要剪下 33 条路径并将它们放置在单独的绘图中。然后您可以单独为它们设置动画。

© www.soinside.com 2019 - 2024. All rights reserved.