0

How I can remove underline from my TextField? I don't want to use different TextField()

val style = TextStyle(
    color = MaterialTheme.colors.primary,
    fontSize = 16.sp,
    fontWeight = FontWeight.SemiBold,
    textDecoration = TextDecoration.None,
    textAlign = TextAlign.Center
)

BasicTextField(
    modifier = Modifier
        .fillMaxWidth()
        .align(Alignment.Center),
    textStyle = style,
    value = value,
    onValueChange = { value = it },
    singleLine = true
)
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Wafi_ck
  • 1,045
  • 17
  • 41
  • Does this help? : https://stackoverflow.com/questions/65780722/jetpack-compose-how-to-remove-edittext-textfield-underline-and-keep-cursor – Mayur Gajra Nov 22 '21 at 13:51
  • No, it doesn't. I've seen that question before – Wafi_ck Nov 22 '21 at 14:57
  • 1
    @Wafi_ck What does it mean: *I don't want to use different TextField()*. In your question you are talking about TextField but in the code you are using a BasicTextField. Which component do you want to use? – Gabriele Mariotti Nov 24 '21 at 09:47
  • Yeah, you"re right. I meant I want to use BasicTextField(), not any different type OutlinedTextField() or TextField() – Wafi_ck Nov 24 '21 at 10:37

0 Answers0