Click here to Skip to main content
12,302,863 members (81,261 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Mobile Android
Please provide me the code for the text view to get scroll. The text is inside the edit text.
Quick response highly appreciated.
Thanks.
Posted 20-Sep-12 23:07pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can use the Scroll View and in between the Text view.
Just Like the code below.
Hope it works fine for you.

            <scrollview>
        android:id="@+id/ScrollView01"  
      android:layout_height="150px"   
      android:layout_width="fill_parent">
  Permalink  
v2
Comments
Adarsh0007 21-Sep-12 5:17am
   
Thank you it solve the purpose.
Aditya_Pandey 21-Sep-12 7:24am
   
You're welcome dear!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

To programmatically scroll a text view use this code.

mTextStatus = (TextView) findViewById(R.id.TEXT_STATUS_ID);
mScrollView = (ScrollView) findViewById(R.id.SCROLLER_ID);
 
private void scrollToBottom()
{
    mScrollView.post(new Runnable()
    {
        public void run()
        {
            mScrollView.smoothScrollTo(0, mTextStatus.getBottom());
        }
    });
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160530.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100