For some reason, CoreTextField works but TextField and OutlineTextField wont
@Composable
fun TextFieldDemo(){
val text = remember { mutableStateOf(TextFieldValue("Text")) }
CoreTextField(modifier = Modifier.fillMaxWidth(),
value = text.value,
onValueChange = {text.value = it})
}
@Composable
fun TextFieldDemo(){
val text = remember { mutableStateOf(TextFieldValue("Text")) }
OutlinedTextField(value = text.value,
onValueChange = {text.value = it}, label = {Text("Test")})
}
Error: Non of the following Functions can be called for OutlinedTextField
From the docs change
Bug Fixes
androidx.ui.foundation.TextFieldValue and androidx.ui.input.EditorValue are deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead (I4066d, b/155211005)
But I'm using what it says (I think)
Edit

You are missing the "label" param in the original question, as we can see in the image. Following Gabriele's comment made it work, so you shouldn't change the question with the answer, it's a lot confusing.
Just for the record, here it`s the code that works in 1.0.0-alpha02:
@Composable
fun TextFieldDemo() {
val text = remember { mutableStateOf(TextFieldValue("Text")) }
OutlinedTextField(value = text.value,
onValueChange = { text.value = it },
label = { Text("Test") })
}
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