Android开发TextView内容从右到左滚动
这个功能比较简单,TextView内容从右到左滚动
一、思路:
用TextView的marqueeRepeatLimit
二、效果图:

三、关键代码:
<com.cong.myrighttolefttextdemo.MarqueeTextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14sp"
android:text="用户创造的好音乐"/>
四、项目demo源码结构图

有问题或者需要完整源码的私信我



















![[ComfyUI]Flux:太美了!古风华服与现代DJ演绎。灼灼荷花瑞,亭亭出水中](https://img-blog.csdnimg.cn/direct/4ef6c3c84f424b47afa657004903bf17.png)