您可以使用 OutlinedTextField 中的 colors 属性添加背景颜色,而不是如下代码所示的修饰符背景
OutlinedTextField(
value = "",
onValueChange = {},
Modifier
.fillMaxWidth()
.padding(
top = 10.dp,
start = 10.dp,
end = 10.dp,
bottom = 10.dp
),
label = { Text("Input") },
colors = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = Green,
unfocusedBorderColor = Yellow,
backgroundColor = your_background_color
),
)