Sololo
05/25/2021, 5:51 AMOutlinedTextField(
modifier = Modifier.fillMaxWidth(),
value = text,
onValueChange = { text = it },
label = { Text("please input sth.") },
trailingIcon = {
Icon(Icons.Filled.Delete, contentDescription = "", modifier = Modifier.clickable(onClick =
}))
}
)
Sololo
05/25/2021, 5:51 AMtheapache64
05/25/2021, 5:51 AMtext
here?Sololo
05/25/2021, 5:52 AMvar text by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(TextFieldValue("ssssss", TextRange(0, 10)))
}
Sololo
05/25/2021, 5:55 AMjim
05/25/2021, 5:56 AMonValueChange
to see if the lambda is getting invoked, try logging the value of text before and after you set it, try logging right above OutlinedTextField
to ensure it is getting recomposed, etc.jim
05/25/2021, 5:57 AMSololo
05/25/2021, 6:01 AMvar text by remember { mutableStateOf("abc") }
Sololo
05/25/2021, 6:01 AMSololo
05/25/2021, 6:02 AMSololo
05/25/2021, 6:02 AMfun OutlinedTextField(
value: String,
theapache64
05/25/2021, 6:03 AMtheapache64
05/25/2021, 6:03 AMSololo
05/25/2021, 6:04 AMtheapache64
05/25/2021, 6:04 AMvar text by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(TextFieldValue("ssssss", TextRange(0, 10)))
}
OutlinedTextField(
modifier = Modifier.fillMaxWidth(),
value = text,
onValueChange = { text = it },
label = { Text("please input sth.") },
trailingIcon = {
Icon(Icons.Filled.Delete, contentDescription = "", modifier = Modifier.clickable(onClick = {
}))
}
)
theapache64
05/25/2021, 6:04 AMSololo
05/25/2021, 6:06 AMSololo
05/25/2021, 6:08 AMtheapache64
05/25/2021, 6:09 AMSololo
05/25/2021, 6:10 AMtiago.casemiro
05/26/2021, 1:33 PM