Android跑马灯效果——TextView文字单行循环

xml中设置:

android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"

代码中设置:

textView.setSingleLine();
textView.setSelected(true);

备注:TextView设置跑马灯之后,右边滚动的时候如有渐变的问题,解决如下:xml中设置:

android:shadowColor="#4C000000"
android:shadowDx="0"
android:shadowDy="1"
android:shadowRadius="3"
发布了55 篇原创文章 · 获赞 61 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/Agg_bin/article/details/89495088