android中不可滚动的textview

Sam*_*Sam 9 android scroll textview autolink

我在我的XML中配置了textview,如下所示.

<RelativeLayout>
   <!-- more views here like ImageView and other TextView-->
    <TextView
        android:id="@+id/message"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:maxLines="4"
        android:textIsSelectable="false"
        android:autoLink="web|phone|email"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

此视图的内容可以是文本,也可以包含HTML内容.因此我将autoLink设置为true.问题是,如果autoLink或textIsSelectable为true,则当textview的内容超过4行时,textview开始滚动,类似于(MovementMethod).我正在寻找一种方法来停止/禁用此textview滚动.

我尝试使用setEnable(false)禁用文本视图的滚动,但此后无法单击textview中的所有链接.

我认为必须有一种直接的方式来实现"不可滚动的textview",其中可能包含html内容.

and*_*anu -2

将椭圆大小设置为文本视图,以便文本不能超过 4 行

也许这就是你的解决方案