1

I'm trying to set up a TextView vertical scroll in the XML layout, it barely works, The scroll seems to move when I hardly swipe down the vertical bar, I mostly get to scroll down the layout instead of the textview, it's difficult.

I attached my code below.

<TextView
    android:id="@+id/evento_descripcion"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:text="@string/t_descripcion"        
    android:textColor="#010101"
    android:layout_below="@+id/evento_fondo"
    android:textSize="16sp"        
    android:layout_marginTop="20dp"
    android:gravity="left"
    android:layout_marginLeft="20dp" 
    android:layout_marginRight="20dp"      
    android:scrollbars="vertical"
    android:fadeScrollbars="false"
    android:scrollbarAlwaysDrawVerticalTrack="true"
    android:scrollbarStyle="insideInset"  


    />

enter image description here

  • Instead of enabling `TextView` scroll you could put `TextView` inside `ScrollView` if that gives you desire scrolling behaviour – Sharj Jun 26 '16 at 01:10
  • I already did it, the thing is that I have 2 scrollview in a layout, the one that wraps all views inside the layout file and now this scrollview for the textview. It works but I have to put two fingers inside the scrollview (for the textview), I keep touching the view with one finger while scrolling down with the other one, otherwise I just scroll down the outside view – Jose Ricardo Citerio Alcala Jun 26 '16 at 16:52

1 Answers1

0

Try adding this to your code

YOURTEXTVIEW.setMovementMethod(new ScrollingMovementMethod());

Also check this and this out, I think it will help you.

Community
  • 1
  • 1
Charles Li
  • 1,635
  • 3
  • 19
  • 40