<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- layout_width 表示控件的大小,只有当文本宽度超过这个值得时候才会移动显示,否则不会移动显示 -->
<!-- 其中 ellipsize=marquee ,表示省略的内容移动显示 -->
<!-- 必须设置的两个属性 focusable=true、 focusableInTouchMode=true -->
<!-- singleLine=true 属性表示单行显现,不会换行 -->
<TextView
android:layout_width="40px"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:text="这是一个测试文本..........." />
</LinearLayout>