跑马灯效果  
 
 
 当一行文本的内容太多,导致无法全部显示,也不想分行展示时,只能让文字从左向右滚动显示,类 似于跑马灯。电视在播报突发新闻时经常在屏幕下方轮播消息文字,比如“ 
 快讯:我国选手 
 *** 
 在刚刚结束 的** 
 比赛中为中国代表团夺得第 
 ** 
 枚金牌 
 ”。 
 
 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#00aaff"
    android:orientation="vertical"
    >
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:gravity="center"
    android:textSize="35sp"
    android:text="跑马灯效果"/>
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
android:layout_marginTop="20dp"
    android:singleLine="true"
    android:ellipsize="marquee"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:textColor="#ffaa00"
    android:textSize="40sp"
    android:text="红色境界前台风将至,关闭门窗,在家休息"/>
</LinearLayout>
 
  
  跑马灯滚动的效果界面如图 
  。左图为跑马灯文字在滚动中,右图为跑马灯文字停止滚  
 
 
  
  动。  
 
 
 
 
 
















![[JUCE库]关于JUCE如何生成动态链接库 juce-7.0.1-windows](https://img-blog.csdnimg.cn/direct/42ffef263b114abea6a4e20241d00bcf.png)