It`s padding is to large!what can i delete them?
TextField(
value = text,
textStyle = TextStyle(
color = Color.Red,
textDecoration = TextDecoration.None
),
onValueChange = {
text = it
},
placeholder = {
Text(text = "请输入设备序列号", color = Color.Gray)
},
singleLine = true,
activeColor = Color.Yellow,
modifier = Modifier.padding(1.dp),
backgroundColor = Color.Transparent
)
this is my code.please help me !
You can use BasicTextField to take control over it.
var value by rememberSaveable { mutableStateOf("") }
BasicTextField(
cursorBrush = SolidColor(Color.White),
value = value,
onValueChange = { value = it },
textStyle = TextStyle(color = Color.White),
decorationBox = { innerTextField ->
Row(modifier = Modifier.fillMaxWidth()) {
if (value.isEmpty()) {
Text(text = "Placeholder", color = Color.White)
}
}
innerTextField()
}
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With