Ch8n
09/07/2021, 12:25 PMAnastasia Rozovskaya
09/07/2021, 12:35 PMTextField
should be enough
look at examples in the docs
https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#TextField(kotlin.String,kotl[…]se.material.TextFieldColors)Ch8n
09/07/2021, 2:41 PMnitrog42
09/07/2021, 3:29 PMnitrog42
09/07/2021, 3:31 PMColumn {
TextField(value = "", onValueChange = {})
if(error != null) {
Text(text = "Error: $error", color = Color.Red, modifier = Modifier.align(Alignment.End))
}
}
Bradleycorn
09/07/2021, 8:55 PMTextField
, you have to use a wrapper (Column
) and another Text
composable for the error.nitrog42
09/07/2021, 9:35 PMnitrog42
09/07/2021, 9:36 PMI tried it not able to get right aligned error message like in the imagemeant
darkmoon_uk
09/07/2021, 11:49 PMTextField
does not provide for an additional label, in the position you've shown. I also required this to build a 'form' component with validation, and ended up building a composite component from TextField
and Text
in a Column
.Ch8n
09/09/2021, 1:31 PM