0

我在滚动文本区域的文本时遇到问题。我将此 1-Scrollview 的代码结构如下作为垂直布局。2-在这个滚动视图上保持一个视图。3-在此视图上保留文本区域。

在这种结构中,文本滚动不顺畅。

4

2 回答 2

1

我认为您正在寻找此代码。

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/headerlayout"
        android:layout_above="@+id/bottomlayout"
         >

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/text_aboutus"
                    android:layout_marginTop="10dp"
                    android:padding="10dp"
                    android:text="@string/text_data"
                    android:textSize="13sp"
                    android:textColor="#000" />



    </ScrollView>
于 2013-08-05T12:15:33.153 回答
0

如果您需要文本视图的水平滚动,请在 xml 文件中尝试此操作

<HorizontalScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
<TextView
. . . .
</HorizontalScrollView>

如果您需要文本视图的垂直滚动,请在您的活动中尝试此操作

textview.setMovementMethod(ScrollingMovementMethod.getInstance());
于 2013-08-05T11:58:08.273 回答