到目前为止,我有这个-我如何使它 Flink 3秒钟停止3秒钟。然后重复这个直到组合被处理。
@Composable
fun FlashingLight ( size: Dp , color: Color){
val infiniteTransition = rememberInfiniteTransition()
val lightFlashing by infiniteTransition.animateFloat(
initialValue = 0.0f,
targetValue = 1.0f,
animationSpec = infiniteRepeatable(
animation = tween(
durationMillis = 500,
delayMillis = 10,
easing = LinearEasing),
repeatMode = RepeatMode.Reverse
)
)
Canvas(modifier = Modifier
.size(size),
onDraw = {
drawCircle(color = color.copy(alpha = lightFlashing))
})
}
我试过了-不成功
LaunchedEffect(key1 = true) {
repeat(3) {
.........
}
}
谢谢
1条答案
按热度按时间unftdfkk1#
在费力地阅读了文档之后-这很有效。