最近公司的项目中需要一个跑马灯效果,跑马灯效果怎么做。感觉很简单但是有时候用的时候总是会忘记,在这里做一下记录,同时也给他人提供方便。
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="快讯,昨日清晨昨夜风,不到长城非好汉,哇啦啦啦啦啦啦啊啦啦啦阿联阿拉拉拉啊"
android:layout_marginTop="20dp"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"/>