Chris Fillmore
10/15/2021, 3:22 PMBasicTextField
to simply show text, in addition to allowing it to be editable?
That is, instead of doing this:
var isEditing by remember { mutableStateOf(false) }
var text by remember { mutableStateOf("some editable text") }
if (isEditing) {
BasicTextField(...)
} else {
Text(...)
}
You do this:
var isEditing by remember { mutableStateOf(false) }
var text by remember { mutableStateOf("some editable text") }
BasicTextField(
...
value = text,
enabled = isEditing,
decorationBox = { innerTextField ->
Surface(
...
// A visual cue to show that the field is being edited
border = if (isEditing) BorderStroke(...) else null
) {
innerTextField()
}
}
)
Csaba Kozák
10/18/2021, 8:11 AMreadOnly
parameter?Chris Fillmore
10/18/2021, 4:54 PMChris Fillmore
10/18/2021, 4:55 PMCsaba Kozák
10/18/2021, 4:55 PMChris Fillmore
10/18/2021, 4:56 PM