I have 3 main elements in my XML layout (also see the image):
- The header, a linearLayout (nothing exciting here)
- The content, a relativeLayout, there is an image in there that I centered both horizontal and vertical.
- The footer, a linearLayout

What I need this to look like is as following:
- The footer(3) needs to be aligned to the bottom so there is no white space left
- The content(2) needs to fill the space between the header(1) and the footer(3) so the image is always centered precisely between the two elements.
What I’ve tried:
- Setting the content(2) to fill vertically, but it ignores the footer(3) so it overlaps the footer so it isn’t visible anymore.
- I also tried putting the footer(3) in another LinearLayout that fills the bottom part, and then using the gravity attribute I aligned the footer(3) to the bottom, this looks perfect for the footer(3) but the content(2) keeps it’s size (shown on the image) because the footer(3) is already filling up the space below it.
Can anyone help me with setting up the correct layout?
To recap:
I need the footer(3) to be aligned to the bottom (no white space), keep the header(1) at the top, and all the space in between should be filled with the content(2) part so the centering of the image looks right.
I can provide my current XML-Layout code if needed.
Try like this..
make a relative layout as the parent layout of all the 3 other layouts and put
in the last linear layout