title: Android Single Layout to FIt All Screen Sizes
body: <p>I am updating my Android app and realized that I have created a layout for every possible screen size (layout-small, layout-large, etc...)  It would be a huge pain to go through every XML file and manually make a small change.  I am attempting to create a single XML file to support all screen sizes.  After reviewing the Android documentation and other questions on stackoverflow, it seems LinearLayout is the best choice as you can provide a weightSum and layout_weight for each item in the layout.  This is not working as expected (see below code and images).  I am doing this correctly?  Do I have to go back to creating a RelativeLayout for every possible screen size?</p>
  
  <p>My images are an a single drawable folder and my layouts are in a single layout folder.</p>
  
  <p>XML</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/bg"
      android:gravity="center"
      android:orientation="vertical"
      android:weightSum="100" &gt;
  
      &lt;ImageButton
          android:id="@+id/btn1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:adjustViewBounds="true"
          android:scaleType="fitCenter"
          android:src="@drawable/image0"
          android:background="@null"
          android:layout_weight="30" /&gt;
  
      &lt;ImageButton
          android:id="@+id/btn2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:adjustViewBounds="true"  
          android:scaleType="fitCenter"
          android:src="@drawable/image1"
          android:background="@null"
          android:layout_weight="30" /&gt;
  
      &lt;ImageButton
          android:id="@+id/key"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="30"
          android:background="@null"
          android:src="@drawable/image0_key" /&gt;
  
      &lt;TextView
          android:id="@+id/tvScore"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:text="Score: 0"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:layout_weight="10"
          android:layout_gravity="left" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Resulting View (overflow of items and layout not consistent for screen sizes)</p>
  
  <p>Nexus One:</p>
  
  <p><img src="https://i.stack.imgur.com/wtEvK.png" alt="enter image description here"></p>
  
  <p>Tablet:</p>
  
  <p><img src="https://i.stack.imgur.com/hbVAA.png" alt="enter image description here"></p>
  
  <p>EDIT:
  I have added the following drawable-____ folders.  It produces the same result.</p>
  
  <p><img src="https://i.stack.imgur.com/95UzJ.png" alt="enter image description here"></p>