title: Android: Layout looks different on different devices
body: <p>Hi I have an activity with an imageview and a row with buttons at the bottom.The buttons are added to the iconView layout programmatically.When I test my app on my HTC one the buttons are displayed correct.</p>
  
  <p>Once I run it on a device with a smaller screen it is cropped i.e. only the top of the buttons is displayed.</p>
  
  <p>How can I make my code device independent? </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="#000000"
  android:orientation="horizontal" &gt;
  &lt;LinearLayout
      android:id="@+id/mainView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/background2"
      android:orientation="vertical" &gt;
      &lt;ImageView
      android:id="@+id/imageView"
      android:layout_width="fill_parent"
      android:layout_height="0dp"
      android:layout_weight="0.95"
      android:orientation="vertical"
      android:paddingLeft="4dp"
      android:paddingTop="4dp"
      android:paddingRight="4dp"
      android:paddingBottom="4dp"
      android:src="@android:drawable/ic_menu_camera" /&gt;
  
      &lt;LinearLayout
      android:id="@+id/iconView"
      android:layout_weight="0.05"
      android:layout_width="match_parent"
      android:layout_height="60dp"
      android:orientation="horizontal" &gt;
      &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>