是否有可以传递给material 3文本字段的参数来更改底部边框的 colored颜色 ?
我使用的是androidx.Compose.Material 3:Material 3:1.1.2
我以为我可以在Colors参数中更改它,但我似乎看不到这个选项.
colors: TextFieldColors = TextFieldDefaults.colors()
是否有可以传递给material 3文本字段的参数来更改底部边框的 colored颜色 ?
我使用的是androidx.Compose.Material 3:Material 3:1.1.2
我以为我可以在Colors参数中更改它,但我似乎看不到这个选项.
colors: TextFieldColors = TextFieldDefaults.colors()
您需要更改指示器的 colored颜色 状态:
val mutableStateOfText = remember { mutableStateOf("") }
TextField(
placeholder = { Text("placeholder") },
value = mutableStateOfText.value,
onValueChange = {
mutableStateOfText.value = it
},
modifier = Modifier.weight(1f),
colors = TextFieldDefaults.colors(
focusedIndicatorColor = Color.Red,
unfocusedIndicatorColor = Color.Blue,
disabledIndicatorColor = Color.Yellow
)
)