我正在開發一個秒錶應用程序。我想滾動一個TextView
我要滾動只一個TextView。
這裏的XML文件。
activity_main.xml中
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#001729"
android:orientation="vertical" >
<Button
android:id="@+id/btn_rec"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:enabled="false"
android:onClick="myOnClick"
android:text="Record" />
<Button
android:id="@+id/btn_start"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/btn_rec"
android:layout_alignParentLeft="true"
android:onClick="myOnClick"
android:text="Start" />
**<TextView
android:id="@+id/record"
android:layout_width="fill_parent"
android:layout_height="500dp"
android:layout_below="@+id/time_out"
android:layout_above="@+id/btn_start"
android:layout_alignParentLeft="true"
android:padding="10dp"
android:textColor="#FFFFFF"
android:textSize="20sp" />**
<TextView
android:id="@+id/time_out"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/relativeLayout1"
android:layout_marginTop="37dp"
android:gravity="center"
android:text="00:00:00"
android:textColor="#FFFFFF"
android:textSize="60sp" />
我想只滾動TextView的大膽。
我不知道如何在這種情況下,使用滾動型。
我該怎麼辦?謝謝:)
你什麼意思,你要滾動一個TextView?你想讓textview裏面的文本在textview高度固定的位置滾動嗎?請解釋更多 –
給我們一些關於答案的反饋。 –