試試這個代碼。我覺得它管用 val rem = remember {mutableStateOf(true)} Button(onClick = {rem.value = !rem.value}){(text = "animate text!")}val animRem = animateFloatAsState(targetValue = if (rem.value) 1f else .1f) val decoratedLabel: @Composable (() -> Unit) = @Composable { val labelAnimatedStyle = lerp( MaterialTheme.typography.subtitle1, MaterialTheme.typography.caption, animRem.value ) Decoration2( contentColor = TextFieldDefaults.textFieldColors() .labelColor( true, // if label is used as a placeholder (aka not as a small header // at the top), we don't use an error color rem.value, remember { Mutabl