Android:TextView文字跑马灯的效果实现

解决TextView文字显示不全的问题。

  1. 简单设置跑马灯的效果:

<TextView

android:id="@+id/textView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:ellipsize="marquee"

android:focusable="true"

android:focusableInTouchMode="true"

android:text="@string/hello_world"

android:singleLine="true" />

2、此方法存在一个问题,多个TextView的话,只有一个显示跑马灯的效果,解决办法是继承TextView类,重写isFocused方法,使之返回真

posted @ 2014-12-01 21:31  薛遗山  阅读(444)  评论(0编辑  收藏  举报