title: How to make image fill RelativeLayout background without stretching
body: <p>In my Android project, I am not quite sure how to make my background image fill the entirety of the <code>RelativeLayout</code> root element in XML, which is the size of the screen. I want to be sure that this works for all aspect ratios, so the image will clip vertically or horizontally as necessary. Does someone know how to do this easily? I've only seen questions regarding <code>ImageView</code>s and <code>Button</code>s, but not really generic <code>View</code>s.</p>
  
  <p>My XML file currently:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/enclosing_rl"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="@drawable/background"
      android:fitsSystemWindows="false"&gt;
  &lt;!-- Other elements --&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>