Ramz
Ramz

Reputation: 7164

How to animate Text view like marquee?

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?

Upvotes: 4

Views: 5681

Answers (1)

Android
Android

Reputation: 2393

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

Upvotes: 7

Related Questions