在滚动视图上滚动textArea的文本

时间:2013-08-05 11:35:16

标签: javascript android titanium

我正面临着滚动文本区域文本的问题。我有以下代码结构 1-Scrollview作为垂直布局。 2 - 在此滚动视图上保持视图。 3 - 在此视图上保留文本区域。

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

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分:0)

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

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

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

textview.setMovementMethod(ScrollingMovementMethod.getInstance());
相关问题