文本视图中的惯性滚动

时间:2012-03-30 15:09:14

标签: android textview

我有一个充满解析HTML的TextView,内容比手机屏幕长,所以我启用了滚动

tv1.setMovementMethod(new ScrollingMovementMethod());

这样可行,但它只能用手指直接滚动。是否可以进行惯性滚动,例如在网络浏览器,联系人或基本上任何其他应用程序中找到的?我搜索并搜索过,并且无法确定TextView是否可以进行惯性滚动。

1 个答案:

答案 0 :(得分:0)

<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

<TextView
    android:textColor="@color/textColor"
    android:id="@+id/description"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="20dp"

    android:layout_marginTop="8dp"
    android:layout_marginRight="20dp"
    android:layout_marginBottom="16dp"
    android:fontFamily="@font/merriweather_light"
    android:text=""
    android:textSize="20dp">


</TextView>
</ScrollView>

这对我有用。只需将其放在ScrollView块中

相关问题