Is it possible to use long lists of widgets inside RelativeLayout, which in turn is wrapped into ScrollView.
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="800dp"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="800dp"
>
<TextView
android:id="@+id/screen_size_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="50dp"
android:layout_marginTop="30dp"
android:text="@string/screen_size" />
<TextView
android:id="@+id/screen_size_label2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/screen_size_label"
android:layout_below="@+id/screen_size_label"
android:text="@string/screen_size_label" />
<TextView
android:id="@+id/screen_size_label3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/screen_size_label"
android:layout_below="@+id/screen_size_label2"
android:text="@string/screen_size_label" />
// each following child uses android:layout_below="@+id/previous"
When I paste considerable amount of widgets so that the bottom of the screen is achieved the next don’t get placed under the previous ones, as I expected, but instead they try to fit in the screen-box resulting in mess. What I need instead is to place them one under another – so that those that don’t fit into screen-box become accessible through scrolling.
It works fine when I use LinearLayout instead of RellativeLayout, however I’d like to get use of RelativeLayout if it’s possible.
Thanks.
Change the height of
ScrollviewandRelativeLayoutto “fill_parent“