-1

I have textview that include a large text and fill the parent layout.but i don't want to use Scrollview and i want to change the textview properties. How Can I scroll the textview Vertically?

1
  • 3
    Please share the code of your layout and add a screenshot of your problem. Commented Feb 14, 2019 at 5:48

3 Answers 3

3

You can make textview as a child of scrollView, and make textview as height as wrap content.

Sign up to request clarification or add additional context in comments.

1 Comment

This is the best answer I read about how to make a textview scrollable. I tried everything and it wouldn't work until I set height of textview as wrap_content.
1

One general way to do this would be wrap your top level layout in a <ScrollView>, something like this:

<ScrollView android:id="@+id/yourScrollView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="60dp"> <LinearLayout android:id="@+id/yourMainLayout" android:orientation="vertical" android:padding="12dp" <!-- add your other content here --> android:layout_width="match_parent" android:layout_height="wrap_content"> </LinearLayout> </ScrollView> 

Then, inside the above LinearLayout you may add one or more TextView.

Comments

0

In the textview xml Add this:

android:scrollbars = "vertical" 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.