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,795
  • 14
  • 71
  • 113

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,899
  • 7
  • 45
  • 51
3

See this

   TextView textview= (TextView) findViewById(R.id.your_textview_id);
   textview.setMovementMethod(new ScrollingMovementMethod());
Community
  • 1
  • 1
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
1

Just use it this way:

<scrollview

(your code)

/>
user1424394
  • 116
  • 11