Hit*_*ene 5 android android-image android-drawable android-vectordrawable android-jetpack-compose
我创建了矢量可绘制动画,并且想在 Compose 中使用。我在官方文档中发现我需要调用animatedVectorResource. 但AnimatedImageVector在下一个版本之前,整个内容已从 compose 中删除。如何在当前的 compose 版本中启动动画绘图?
您需要更新 compose并添加上次更改日志中所示的1.1.0-alpha01模块androidx.compose.animation:animation-graphics
implementation("androidx.compose.animation:animation-graphics:1.1.0-alpha01")
Run Code Online (Sandbox Code Playgroud)
val image = animatedVectorResource(id = R.drawable.animated_vector)
val atEnd by remember { mutableStateOf(false) }
Icon(
painter = image.painterFor(atEnd = atEnd),
contentDescription = null
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5044 次 |
| 最近记录: |