I have a Layout problem. I have tried for hours to get it right but I cant figure it out.
It should be simple really.
I have a layout that looks like this: Fixed on the Screen are a header and a footer, in between these there is a scrollale view that displays some information and a button.
All I want that header, button and footer is fixed and the infomration fill the rest of the screen as good as possible.
The solution I have at moment almost works, the problem with it is that the information and the button overlap (the button is on top). The information only starts to scroll if it would overlap with the footer.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/wrap_main" >
<include
android:id="@+id/in_header"
layout="@layout/header" />
<RelativeLayout
android:id="@+id/body"
style="@style/wrap_body_with_footer_style"
android:layout_below="@id/in_header" >
<!-- This is a scrollable view -->
<include android:id="@+id/job_description"
layout="@layout/job_description" />
<Button android:id="@+id/btn_job_details_pick_up_submit"
style="@style/btn_confirmation_style"
android:text="@string/btn_job_details_pick_up_submit"
android:layout_alignParentBottom="true" />
</RelativeLayout>
<include layout="@layout/footer_krest_home_phone" />
</RelativeLayout>
So JobDiscription and Button overlap.
Any Ideas?
Thanks everybody.
Edit: Somebody mention LinearLayouts in the comments. I did try with LinearLayouts but I had the effect that the information, instead of contracting, pushed down the button so it was not fully visable anymore. If you have a solution to stop this pusing down effect, I’ll happly change to LinearLayouts.
As already discussed in the comments, I would also suggest positioning job_description above btn_job_details_pick_up_submit with
android:layout_above="@id/btn_job_details_pick_up_submit".Above does not mean on top of something, it aligns the bottom of the view with the top of another one.