2

Actually im showing some data in a textview but its half of the data is going out of the screen so i need help to make a textview scroll or any other thing that can scroll down the screen.

Any help would be appreciated!

Mohammad Areeb Siddiqui
  • 9,485
  • 13
  • 67
  • 111

3 Answers3

16

Put your TextView inside ScrollView in XML like:

 <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <TextView
            android:id="@+id/txt2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="txt2"/>

    </ScrollView>
Imran Rana
  • 11,739
  • 7
  • 44
  • 51
3

See this

   TextView textview= (TextView) findViewById(R.id.your_textview_id);
   textview.setMovementMethod(new ScrollingMovementMethod());
Community
  • 1
  • 1
Zar E Ahmer
  • 32,807
  • 18
  • 222
  • 281
1

Just use it this way:

<scrollview

(your code)

/>
user1424394
  • 126
  • 11