我有一个文本视图需要使用动画沿屏幕滚动(就像在新闻频道上闪烁的新闻一样),现在我该如何在Android中实现它?我尝试了这个答案,但没有得到解决方案,请帮帮我吗?
我有一个文本视图需要使用动画沿屏幕滚动(就像在新闻频道上闪烁的新闻一样),现在我该如何在Android中实现它?我尝试了这个答案,但没有得到解决方案,请帮帮我吗?
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类
TextView tv = (TextView) this.findViewById(R.id.mywidget);
tv.setSelected(true); // Set focus to the textview