显示跑马灯效果的前提条件就是你的文本内容要比显示文本的外部组件长,即外部组件无法完整的显示内部的文本内容
activity_main.xml
//两个TextView
<com.example.textview.marqueeTextView (原本的TextView改为包名.类名)
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<com.example.