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?
- 3Please share the code of your layout and add a screenshot of your problem.Reaz Masud– Reaz Masud2019-02-14 05:48:45 +00:00Commented Feb 14, 2019 at 5:48
Add a comment |
3 Answers
You can make textview as a child of scrollView, and make textview as height as wrap content.
1 Comment
Geoffroy CALA
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.
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.