android 字幕,Android中的字幕文本
這是一個例子:public?class?TextViewMarquee?extends?Activity?{
private?TextView?tv;
@Override
protected?void?onCreate(Bundle?savedInstanceState)?{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv?=?(TextView)?this.findViewById(R.id.mywidget);
tv.setSelected(true);??//?Set?focus?to?the?textview
}}
帶有textview的xml文件:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:id="@+id/mywidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:maxLines="1"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:textColor="#ff4500"
android:text="Simple?application?that?shows?how?to?use?marquee,?with?a?long?text"?/>
總結
以上是生活随笔為你收集整理的android 字幕,Android中的字幕文本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一瓶白酒多少钱啊?
- 下一篇: 天谕手游星辰灯塔在哪里?