跑马灯的效果在xml上,大家都是一样的代码
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:ellipsize="marquee"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:focusable="true"
但是貌似有的人能跑,有的人的不会。自己的刚刚就不会。
在stackoverflow上看到一家伙的方法,TextView.setSelect(true);
我试了,这个方法有效!