滚动文本视图就像html中的选框一样

时间:2012-12-28 09:25:51

标签: android textview marquee

您好我需要在我的应用中添加连续滚动的文字视图。

我需要更新网站上的文字。

任何人都可以告诉我任何可以找到代码的教程。

提前感谢您的帮助。

2 个答案:

答案 0 :(得分:4)

使用此:

        <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" />

活动:

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

感谢。

答案 1 :(得分:1)

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

试试这个网站可能会有用。