I want to create TextField with exact 3 lines:

I want to see 3 lines even without any text in this TextField, i.e. I need a direct equivalent of EditText.lines in classic xml layout.
My not working code is:
OutlinedTextField(
value = currentText,
onValueChange = { currentText = it },
label = { Text ("Label") },
maxLines = 3,
modifier = Modifier.fillMaxWidth().wrapContentHeight().padding(16.dp),
singleLine = false
)
Could you help me?
Starting from Starting from M2 1.4.0-alpha02 and M3 1.1.0-alpha02 you can use the minLines attribute in the TextField and OutlinedTextField:
OutlinedTextField(
value = text,
onValueChange = { text = it },
label = { Text ("Label") },
minLines = 3,
maxLines = 3,
modifier = Modifier.fillMaxWidth().wrapContentHeight().padding(16.dp)
)

It can be used with M2 and M3.
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