我有一个已解析HTML的TextView,内容比电话屏幕长,因此我启用了使用
tv1.setMovementMethod(new ScrollingMovementMethod());
Run Code Online (Sandbox Code Playgroud)
可以,但是只能用手指直接滚动。是否可以像在Web浏览器,联系人或基本上其他任何应用程序中那样进行惯性滚动?我进行了搜索,无法找到TextView是否可以进行惯性滚动。
小智 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>
Run Code Online (Sandbox Code Playgroud)
这对我有用。只需将其放在 ScrollView 块内即可
| 归档时间: |
|
| 查看次数: |
1491 次 |
| 最近记录: |