跑马灯效果很简单,组合TextView的属性即可
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"/>
如上,singleLine设为true,ellipsize设为marquee及表示跑马灯,marqueeRepeatLimit设置跑马灯循环次数