I have a simple question for you: is it possible to force no screen overflow in a layout that contains a ScrollView?
For instance, if i have the following layout:
<LinearLayout
android:id="@+id/wrapper_table"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</TableLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
</LinearLayout>
If The TableLayout has many TableRow the Scrollview is being expanded up to the end of the screen and the lower LinearLayout is no more visible. Is it possible to force, without set height, ScrollView height in order to let enough space to display the lower LinearLayout?
Thank you!!
Apply an
android:layout_weightto theScrollView; this way it will take up whatever space is not taken by the other elements.In the adjustments below, the two
LinearLayouts will take up enough space to accomodate their content, and theScrollViewwill take up whatever is left: