Scrolling text view like a marquee in html

别说谁变了你拦得住时间么 提交于 2020-01-03 04:49:14

问题


Hi i need to add a continuously scrolling text view to my app.

I need to update the text from a website .

Can anyone tell me any tutorials where i can find the code to do it.

Thanks for your help in advance.


回答1:


http://androidbears.stellarpc.net/?p=185

Try this website it may be usefull.




回答2:


Use this:

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

In Activity :

tv = (TextView) findViewById(R.id.textId);
tv.setSelected(true);

Thanks.



来源:https://stackoverflow.com/questions/14067294/scrolling-text-view-like-a-marquee-in-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!