0

Hoping someone can shed some light.

I've currently got a ScrollView(vert), to which a TableLayout gets programmatically added to it, to said TableLayout a TableRow is added, to which a TextView along with other similar views are added.

The problem is that this text can be longer than the screen and I need a way to make the text in the TextView scroll automatically unlimited amount of times.

Note there can be quite a few of these table rows added to the one table layout.

Maheshwar Ligade
  • 6,709
  • 4
  • 42
  • 59

1 Answers1

0

If you want only the horizontal scroll like marquee then below is the code

<TextView
    android:text="START | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | END"
    android:id="@+id/MarqueeText" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:singleLine="true"
    android:ellipsize="marquee" 
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true" 
    android:paddingLeft="15dip" 
    android:paddingRight="15dip" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:freezesText="true">

if you want the custom one extended marquee effect. Hope this is useful for you.

Maheshwar Ligade
  • 6,709
  • 4
  • 42
  • 59
  • I've seen this posted a few times, the problem is that the TextViews are created programmatically. Is there a way to set a custom view if I were to create a TextView XML? –  Aug 25 '15 at 13:15
  • fallow this link here is complete code with custom TextView http://stackoverflow.com/questions/3332924/textview-marquee-not-working – Maheshwar Ligade Aug 25 '15 at 14:09