I have seen a lot of answers of this question here, but none of them really worked for me (the only exception was bottom padding, which I consider an ugly workaround).
I have a ScrollView inside a LinearLayout inside Fragment. The last line (or so) of the content cannot be seen, since it is hidden behind the buttons.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="domain.idiotic.no.majlen.jidelnicek.MainActivity$PlaceholderFragment"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Medium Text"
android:id="@+id/section_label"
android:layout_weight="0"
android:layout_gravity="center_horizontal" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/scrollView"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listLayout">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/textView"
android:width="0px"
android:layout_weight="0.8" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/textView2"
android:width="0px"
android:layout_weight="0.2" />
</TableRow>
</LinearLayout>
</ScrollView>
</LinearLayout>
This issue persists if I remove the "Medium text" TextView, so that's not the View that causes it. I have tried setting different layout_heights and layout_weights of all the Views that are supposed to stretch but I have had no luck so far.
Demonstration of the issue described, all the items are supposed to be doubled