Android 文本视图中的惯性滚动
我有一个文本视图,里面满是解析过的HTML,内容比手机屏幕还长,所以我使用Android 文本视图中的惯性滚动,android,textview,Android,Textview,我有一个文本视图,里面满是解析过的HTML,内容比手机屏幕还长,所以我使用 tv1.setMovementMethod(new ScrollingMovementMethod()); 这是可行的,但它只能用手指直接滚动。有没有可能像在网络浏览器、通讯录或其他应用程序中一样进行惯性滚动?我已经搜索了又搜索,但一直无法确定TextView是否可以进行惯性滚动。 <ScrollView android:layout_width="wrap_content"
tv1.setMovementMethod(new ScrollingMovementMethod());
这是可行的,但它只能用手指直接滚动。有没有可能像在网络浏览器、通讯录或其他应用程序中一样进行惯性滚动?我已经搜索了又搜索,但一直无法确定TextView是否可以进行惯性滚动。
<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块中即可否,没有内置的支持。但是,您可以通过跟踪
TextView
和所有内容上的触摸来实现您的。但是你不能把文本视图
放在滚动视图
中吗?这将为您提供所需的惯性滚动。