Hello I have a OutlinedTextField, and I want to add text to end of it so it is always there.
OutlinedTextField(
value = screenState.batterySize.toString(),
onValueChange = onBatterySizeChange,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
textStyle = MaterialTheme.typography.subtitle1.copy(
color = MaterialTheme.colors.primary,
textAlign = TextAlign.Center
)
)
I tried Suffix but that did not work.
lets if the user types 200, km should be there always, so should look "200 km"
any suggestions on how I can achieve that please thank you R
EDIT
how I tried to add suffix when I added suffix like this:
OutlinedTextField(
value = screenState.batterySize.toString(),
onValueChange = onBatterySizeChange,
suffix = Text(text = "test"),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
textStyle = MaterialTheme.typography.subtitle1.copy(
color = MaterialTheme.colors.primary,
textAlign = TextAlign.Center
)
)
I get this error:
None of the following functions can be called with the arguments supplied.
OutlinedTextField(TextFieldValue, (TextFieldValue) → Unit, Modifier = ..., Boolean = ..., Boolean = ..., TextStyle = ..., (() → Unit)? = ..., (() → Unit)? = ..., (() → Unit)? = ..., (() → Unit)? = ..., Boolean = ..., VisualTransformation = ..., KeyboardOptions = ..., KeyboardActions = ..., Boolean = ..., Int = ..., MutableInteractionSource = ..., Shape = ..., TextFieldColors = ...) defined in androidx.compose.material
OutlinedTextField(String, (String) → Unit, Modifier = ..., Boolean = ..., Boolean = ..., TextStyle = ..., (() → Unit)? = ..., (() → Unit)? = ..., (() → Unit)? = ..., (() → Unit)? = ..., Boolean = ..., VisualTransformation = ..., KeyboardOptions = ..., KeyboardActions = ..., Boolean = ..., Int = ..., MutableInteractionSource = ..., Shape = ..., TextFieldColors = ...) defined in androidx.compose.material