Issue
Text(
text = "Resend OTP",
fontSize = 20.sp,
color = Textfieldcolor,
style = TextStyle(textDecoration = TextDecoration.Underline)
)
//This is my code this text should be selectable once and then be disabled .
Solution
You can add the clickable
modifier or can use the ClickableText
:
var enabled by remember { mutableStateOf(true)}
ClickableText(
text = AnnotatedString(text) ,
onClick = {
if (enabled) {
enabled = false
text = "Disabled"
}
})
Answered By – Gabriele Mariotti
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0