如何像文本框一样动画文本视图?

Ram*_*amz 4 animation android

我有一个文本视图,我需要使用animation.now屏幕上的那些屏幕(如新闻频道上的flash新闻),如何在android中实现这个我试过 这个答案

但没有得到解决方案请帮忙?

And*_*oid 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" 
     />
Run Code Online (Sandbox Code Playgroud)

java类

    TextView tv = (TextView) this.findViewById(R.id.mywidget);  
    tv.setSelected(true);  // Set focus to the textview
Run Code Online (Sandbox Code Playgroud)

  • Android(用户):是的我要编辑你的答案,我们需要做一点修改才能做到这一点 (2认同)