title: Force RecyclerView to bottom of page in layout
body: <p>I have a page that consists of an <code>ImageView</code>, and a <code>RecyclerView</code>. The <code>RecyclerView</code> contains a small number of items (currently three) and only takes up around a quarter of the screen on my test device. However, despite trying numerous layout options, I cannot get the <code>RecyclerView</code> to effectively wrap its content and take up just enough space required to contain these three rows, and leave the rest of the space for my <code>ImageView</code>.</p>
  
  <p>To help illustrate what I mean, I have drawn two diagrams. The first shows what I would like to happen, and the second what is happening:</p>
  
  <p><img src="https://i.stack.imgur.com/mu2YM.png" alt="This is the Correct Layout"> <img src="https://i.stack.imgur.com/VaxSj.png" alt="This is the current (incorrect) layout"></p>
  
  <p>So far, I have tried several different combinations of <code>RelativeLayout</code> - for instance, I will set <code>RecyclerView</code> to <code>layout:align_ParentBottom</code> and the second <code>RelativeLayout</code> that contains the <code>ImageView</code> to <code>layout:alignComponent</code> so that its bottom matches the <code>RecyclerView</code> top (this would normally drag the <code>ImageView</code> layout so that it fills any reminaing space, which is what I would like to happen.)</p>
  
  <p>The <code>RecyclerView</code> though just keeps occupying all the space it can, even though it only contains a few rows. The current "solution" I have is to place everything inside a <code>LinearLayout</code> and set less <code>gravity</code> to the <code>RecyclerView</code>, but it isn't ideal, because on different emulators it wont line up completely with the bottom of the screen, and in others there isn't enough room and the <code>RecyclerView</code> becomes scrollable.</p>
  
  <p>Thanks in advance for any help and suggestions anyone can offer.</p>