TextView 滚动效果
android:singleLine=“true”
设置文本单行显示,即不换行。
android:ellipsize=“marquee”
当文本内容过长时,使用跑马灯(marquee)效果显示省略号。
android:marqueeRepeatLimit=“marquee_forever”
设置跑马灯效果的重复次数为无限循环。
android:focusable=“true” 和 android:focusableInTouchMode=“true”
设置控件可获取焦点,并且可以通过触摸屏幕获取焦点。
android:scrollHorizontally=“true”
当文本内容过长时,设置文本水平滚动显示。
android:scrollbars=“none”
隐藏滚动条。
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:scrollbars="none"/>