<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:singleLine="true"
android:focusableInTouchMode="true"
android:text="@string/hello_world" />
在string.xml文件中添加<string name="hello_world">我是一个TextView我是一个长TextView我是一个长TextView</string> 运行即可