7

I want to have a simple TextView with horizontal scrolling, I know that I use HorizontalScrollview for that and I want the text to be autoscrolled continuously. Is that possible?

Hayate
  • 93
  • 1
  • 3

2 Answers2

4

You could use android:ellipsize="marquee" in the TextView attributes or by implement your own animation

Francesco Laurita
  • 23,434
  • 8
  • 55
  • 63
1

This is small example for auto scroll text view simply using XML, no need to code Java. Hope you will like it! Try it on your own, it is very easy to perform

Try this :

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform" />

Click here to see the Output

Here text will scroll automatically and you will get infinite scroll. Have fun!

Click here to see detailed tutorial