Reputation: 319
How to make a Text or TextField which will scroll its content automatically horizontally while content is longer than size in android jetpack compose? Like horizontal Marque
I know that I can use:
modifier = Modifier.fillMaxWidth(0.7f).horizontalScroll(rememberScrollState())
but it doesn't scroll automatically, I have to drag it.
Upvotes: 0
Views: 807
Reputation: 364005
Starting from 1.4.0-alpha04
you can use the basicMarquee
modifier:
// Marquee only animates when the content doesn't fit in the max width.
Column(Modifier.width(100.dp)) {
Text("hello world hello world hello world",
modifier = Modifier.basicMarquee())
}
Upvotes: 4