<?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" >
<TextView
android:id="@+id/textView01"
android:layout_width="300px" //一定得設成某個值,否則不動
android:layout_height="wrap_content"
android:text="This is a test of marquee on the textView in android"
android:ellipsize="marquee"
android:scrollHorizontally="true"
android:singleLine="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:textColor="#00FF00"
android:textSize="25dip"/>
<Button
android:id="@+id/button1"
android:scrollHorizontally="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_marginTop="20dip"
android:layout_width="250px"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:textColor="#FF00FF"
android:text="@string/hello" />
</LinearLayout>
******************
按下按鈕時,按鈕上的馬跑燈將啟動,但TextView的跑馬燈將停止
程式裡的 tv.setMarqueeRepeatLimit(-1); 循環
沒有留言:
張貼留言