This question already has an answer here:
- Marquee text in Android 15 answers
I have tried to use marquee and its not working here is my code, please let me know where im going wrong
<TextView
android:text="lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00"
android:id="@+id/TextView02"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:marqueeRepeatLimit="marquee_forever"
android:ellipsize="marquee"
android:singleLine="true"
android:focusable="true"
android:inputType="text"
android:maxLines="1">
</TextView>
i am using android SDK 2.0.1
must call in code
To have your own scroll speed and flexibility to customize marquee properties, use the following:
Within your activity:
Working Code:
I've encountered the same problem. Amith GC's answer(the first answer checked as accepted) is right, but sometimes textview.setSelected(true); doesn't work when the text view can't get the focus all the time. So, to ensure TextView Marquee working, I had to use a custom TextView.
And then, you can use the custom TextView as the scrolling text view in your layout .xml file like this:
NOTE: in the above code snippet com.example.myapplication is an example package name and should be replaced by your own package name.
Hope this will help you. Cheers!
android:focusable="true" and android:focusableInTouchMode="true" are essential....
Because I tested all others without these lines and the result was no marquee. When I add these it started to marquee..
Very Simple working code:
For infinitely scrolling text
& you should must write from your activity