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?
2 Answers
You could use android:ellipsize="marquee" in the TextView attributes or by implement your own animation
1 Comment
Francesco Laurita
A side note: The default marquee animation starts only if the TextView being selected.
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" /> Here text will scroll automatically and you will get infinite scroll. Have fun!