-1

When ever I use the Text() function, it shows this error:

None of the following functions can be called with the arguments supplied.
Text(AnnotatedString, Modifier = ..., Color = ..., TextUnit = ..., FontStyle? = ..., FontWeight? = ..., FontFamily? = ..., TextUnit = ..., TextDecoration? = ..., TextAlign? = ..., TextUnit = ..., TextOverflow = ..., Boolean = ..., Int = ..., Int = ..., Map<String, InlineTextContent> = ..., (TextLayoutResult) → Unit = ..., TextStyle = ...)

I tried to create a seperate function for this, but the text field does not get executed:

fun Text(s: String, Style: TextStyle) {

}

Although errors get removed by using seperate functions.

1
  • Please edit your question and add the code that you have problems with. How do you want to call Text in the first place? Commented Jun 29, 2024 at 11:55

1 Answer 1

0

You are attempting to override a NEW "Text" function, which cannot be overridden. If you want to create a new Text, try using this code.

@Composable
fun MyText(s: String, style: TextStyle) {
Text(text = s, style = style) }
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.