I have a ScrollView at the top node of an activity, with several TextView inside. I want some of these (1 out of 2) TextView scrollable themselves. They are doing more than 5 lines each but I want visitor see only 5 lines and have to scroll to watch the complete text. But what I do... doesn't work:
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textStyle="italic" android:text = "Blabla"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blanc" android:maxLines="5" android:scrollbars="vertical" android:text="Blablabla1\nBlablabla2\nBlablabla3\nBlablabla4\nBlablabla5\nBlablabla6\nBlablabla7\nBlablabla8\n"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textStyle="italic" android:text = "Blabla"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blanc" android:maxLines="5" android:scrollbars="vertical" android:text="Blablabla1\nBlablabla2\nBlablabla3\nBlablabla4\nBlablabla5\nBlablabla6\nBlablabla7\nBlablabla8\n"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textStyle="italic" android:text = "Blabla"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blanc" android:maxLines="5" android:scrollbars="vertical" android:text="Blablabla1\nBlablabla2\nBlablabla3\nBlablabla4\nBlablabla5\nBlablabla6\nBlablabla7\nBlablabla8\n"/> </LinearLayout> </ScrollView> Doing that, TextViews put 5 first lines, but they are not scrollable.
What do I do wrong?