TextView: How to make it scrollable without using ScrollView?

You don’t need to use ScrollView. How to do that?

Step 1. From XML, add some properties for TextView, like this:

android:maxLines = "AN_INTEGER"

android:scrollbars = "vertical"

Step 2. In your code: yourTextView.setMovementMethod(new ScrollingMovementMethod());

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s