Home > Enterprise >  Can't add modifier to a Text composable
Can't add modifier to a Text composable

Time:07-20

I can't add a modifier to a Text in my android app in Jetpack Compose.

I want something like this:

Text(
   text = AnnotatedString(resultString),
   Modifer = Modifier.horizontalScroll(scroll),
)

But it gives me an error: None of the following functions can be called with the arguments supplied.

I tried it without the modifier and then it worked.

(I'm using material3)

CodePudding user response:

The attribute is modifier.

Use

Text(
   text = AnnotatedString(resultString),
   modifer = Modifier.horizontalScroll(scroll),
)
  • Related