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?

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

A side note: The default marquee animation starts only if the TextView being selected.
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

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.