滚动视图中text区域的滚动文本

scroll text of textArea on scroll view

本文关键字:滚动 文本 区域 text 视图      更新时间:2023-09-26

我在滚动文本区域的文本时遇到问题。我有以下代码结构1-垂直布局的横截面图。2-在此滚动视图上保持视图。3-在此视图上保留文本区域。

在这种结构中,文本滚动不平滑。

我想您正在寻找这段代码

<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>

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

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

如果您需要滚动文本查看,请在活动中尝试此操作

textview.setMovementMethod(ScrollingMovementMethod.getInstance());