gabriel119435
gabriel119435

Reputation: 6792

How I do to roll the text to the bottom?

I'm programming on ADK and I got one screen with a text at a huge font so the whole text can't appear on the screen. I want to know to do slide the finger up and see the text below, sliding it as we do with normal texts on Android.

Upvotes: 0

Views: 196

Answers (2)

GrIsHu
GrIsHu

Reputation: 23638

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>

OR If You don't need to use a ScrollView actually.

Just set the

     android:maxLines = "AN_INTEGER"
     android:scrollbars = "vertical"

properties of your TextView in your layout's xml file.

Then use:

   yourTextView.setMovementMethod(new ScrollingMovementMethod())

in your code.

It scrolls automatically without any issues.

Upvotes: 1

Related Questions