Sunday, May 15, 2011

Scrollable Text View in andriod


This article helps to making Scrollable TextView in Android.

We can do it two ways. 1.Create a TextView inside the ScrollView and 2. TextView with dispatch Events.


Create a TextView inside the ScrollView
< ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:fillViewport="true">
< LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
< TextView android:text="@+id/TextView01"
android:id="@+id/mTextView"
android:layout_width="fill_parent"
android:layout_height="fill_parent">< / TextView>

< / LinearLayout>
< / ScrollView>

Activity Implementation
mTextView = (TextView) findViewById(R.id.logTextView);
mTextView .setText("");
mTextView .setMovementMethod(ScrollingMovementMethod.getInstance());

0 comments:

Post a Comment

 
© 2011 collection of android application | Except as noted, this content is licensed under Creative Commons Attribution 2.5.
For details and restrictions, see the Content License | Recode by Ardhiansyam | Based on Android Developers Blog