4

I have a text view i need to marquee those along the screen(like the flash news flashing on news channels) using animation.now how can i implement this in android i tried this answer

but did not get the solution please help?

Community
  • 1
  • 1
Ramz
  • 7,116
  • 6
  • 63
  • 88

1 Answers1

7

main.xml

    <TextView
    android:id="@+id/mywidget"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:lines="1"
    android:ellipsize="marquee"
    android:fadingEdge="horizontal"
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true"
    android:textColor="#ff4500"
    android:text="Simple application that shows how to use marquee, with a long text" 
     />

java Class

    TextView tv = (TextView) this.findViewById(R.id.mywidget);  
    tv.setSelected(true);  // Set focus to the textview
Android
  • 2,383
  • 1
  • 26
  • 44