跑马灯效果(文字要足够长):
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"/>
自动链接(电话.Email.网址都可以支持自动转换成链接):
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:autoLink="all"
android:text="@string/name"/>
文本删除线
textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
备注:TextView的Text可加载自HTML文件或HTML字符串
TextView t3 = (TextView) findViewById(R.id.text3);
t3.setText(
Html.fromHtml(
"<b>text3:</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML."));