CoderzHeaven

February 15, 2012

How to create a scrollable TextView in android?

The simplest way to create a Scrolling TextView in android is to place it inside a ScrollView.
Here is a sample xml file with a scrollable TextView.

<?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"><ScrollViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:fillViewport="true"><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="fill_parent"><TextView android:text="sample text "android:id="@+id/tv"android:layout_width="fill_parent"android:layout_height="fill_parent"></TextView></LinearLayout></ScrollView></LinearLayout>
Website PinFacebook TwitterMyspaceFriendfeedTechnoratidel.icio.usDiggGoogleStumbleUponPremium Responsive

Leave a Reply Cancel reply