ScrollView is an essential component in any UI framework. Understanding and mastering this component is essential. At the point I wrote this all I needed was to scroll a text view. It looks like Android allows TextView to scroll by itself without the help of embedding it in a ScrollView control. For now you can use this document to understand how to scroll a TextView without the the help of a ScrollView. Perhaps in the future this document will be expanded for a broader coverage of ScrollView.

satya - Friday, February 04, 2011 2:57:15 PM

android how to scroll textview

android how to scroll textview

Search for: android how to scroll textview

satya - Friday, February 04, 2011 2:57:38 PM

ScrollView api

ScrollView api

satya - Friday, February 04, 2011 3:13:34 PM

ScrollingMovementMethod

ScrollingMovementMethod

Search for: ScrollingMovementMethod

satya - Friday, February 04, 2011 3:14:57 PM

ScrollingMovementMethod api

ScrollingMovementMethod api

satya - Friday, February 04, 2011 3:30:43 PM

working with scrollbar views

working with scrollbar views

satya - Friday, February 04, 2011 3:58:04 PM

scrollbarAlwaysDrawVerticalTrack

scrollbarAlwaysDrawVerticalTrack

Search for: scrollbarAlwaysDrawVerticalTrack

satya - Friday, February 04, 2011 3:58:20 PM

see this about fading instead

see this about fading instead

satya - Friday, February 04, 2011 3:59:39 PM

scrollbarFadeDuration

scrollbarFadeDuration

Search for: scrollbarFadeDuration

satya - Friday, February 04, 2011 4:01:28 PM

android scrollbarSize

android scrollbarSize

Search for: android scrollbarSize

satya - Friday, February 04, 2011 4:03:35 PM

Sample scroll bar xml from google samples

Sample scroll bar xml from google samples

satya - Friday, February 04, 2011 4:04:01 PM

set scrollbarFadeDuration to "0" to show scrollbar

set scrollbarFadeDuration to "0" to show scrollbar

satya - Friday, February 04, 2011 4:11:39 PM

ScrollbarSize seem to be broken for now

ScrollbarSize seem to be broken for now

Reporting to be available in the future.

satya - Friday, February 04, 2011 4:11:54 PM

My scrollable text view


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="fill"
    >
<TextView android:id="@+id/textViewId"  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:background="@android:color/white"
    android:text="@string/hello"
    android:textColor="@android:color/black"
    android:textSize="@dimen/medium_size"
    android:scrollbars="vertical"
    android:scrollbarStyle="insideOverlay"
    android:scrollbarSize="25dip"
    android:scrollbarFadeDuration="0"
    />
</LinearLayout>

satya - Friday, February 04, 2011 4:15:22 PM

You got to do this for the textview to make scrolling work


TextView tv = this.getTextView();
tv.setMovementMethod(new ScrollingMovementMethod());
or
tv.setMovementMethod(ScrollingMovementMethod.getInstance());

satya - 7/26/2014 9:23:57 AM

In Android how do I programatically tell a textview to scroll up

In Android how do I programatically tell a textview to scroll up

Search for: In Android how do I programatically tell a textview to scroll up

satya - 7/26/2014 9:24:12 AM

Here is an SOF discussion

Here is an SOF discussion

satya - 7/26/2014 9:38:02 AM

android textview scroll to bottom

android textview scroll to bottom

Search for: android textview scroll to bottom

satya - 7/26/2014 9:38:09 AM

Use this SOF reference

Use this SOF reference

satya - 7/26/2014 9:39:12 AM

Use this one instead

Use this one instead

satya - 7/26/2014 9:54:02 AM

It is actually quite easy if all you want to do is to auto scroll to bottom as you append...


Just set the android:gravity="bottom" on the text view

satya - 7/26/2014 10:03:30 AM

Alternatively you can embed the textview in a scrollview

Alternatively you can embed the textview in a scrollview

satya - 7/26/2014 10:03:49 AM

At some point in all UI you have to master the ScrollView!!

At some point in all UI you have to master the ScrollView!!