I am having some battles with a scrollview and a framelayout. Despite trying numerous things no matter what I do the scrollview seems to fill the parent and stick some of my content behind the framelayout.
What I want is the framelayout across the bottom and the scrollview to fill the top section. Can anyone point out the silly mistake I am making here?
I tried what was suggested here Layout issue on Android with FrameLayout and ScrollView but that didn’t do it.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/quizresultlayout"
style="@style/Activity"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/resultscroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/frameLayout1"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/sublayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/tvResultMsg"
style="tvtemplatemedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tag="@string/quizresults_CongratsMsg"
android:text="@string/quizresults_CongratsMsg" />
<TableLayout
android:id="@+id/resultable"
android:layout_width="wrap_content"
android:layout_height="match_parent" >
</TableLayout>
</LinearLayout>
</ScrollView>
<FrameLayout
style="@style/bottomframe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="92dp" >
<ImageButton
android:id="@+id/btnstartquiz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/play" />
<ImageButton
android:id="@+id/btnRptCard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:src="@drawable/chart" />
<ImageButton
android:id="@+id/btnTrunk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@drawable/play" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
Do this:
change the root RelativeLayout to LinearLayout.
set the ScrollView android:layout_height=”0dp”
add to ScrollView android:layout_weight=”1″ <– this will make your scrollview fill the remaining space and will push the framelayout at the bottom.