Home » Android » scroll – Non scrollable textview in android

scroll – Non scrollable textview in android

Posted by: admin June 15, 2020 Leave a comment


I have a textview configured in my XML as below.

   <!-- more views here like ImageView and other TextView-->

The content for this view could be text and may also contain HTML content. Hence I have set autoLink to true. The issue is, if either the autoLink or the textIsSelectable is true, then the textview starts to scroll similar to(MovementMethod) when its content is more than 4 lines. I am looking for a way to stop/disable this textview scrolling.

I tried to disable the scrolling using setEnable(false) for the text view, however all the links in the textview could not be clicked thereafter.

I think there has to be a straight forward way to achieve “non-scrollable textview” which may contain html content in them.

How to&Answers:

set ellipsize to the text view so text can’t be greater than 4 lines

may be this is solution for you


Try changing ‘Relative Layout’ to ‘Table layout’… If this doesn’t work then try to set appropriate padding and margin for Textview and other widgets.