title: Same position for UI elements (buttons, image buttons) on all android devices
body: <p>My application uses buttons and image buttons constructed via XML and drawable folder.<br>
  On some devices applications UI elements (buttons and image buttons) losses its position and overlaps on each other and on some devices last button in bottom of screen  disappears.<br>
  Same is happening when orientation is changed.  </p>
  
  <p>I want all my elements to be on same position on all devices.<br>
  How can I make this using XML.<br>
  Is there any easy and simple way to do so?<br>
  Here is my XML.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/bg"
      android:orientation="vertical" &gt;
  
      &lt;ImageButton
          android:id="@+id/main_btn_1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="55dp"
          android:layout_marginTop="71dp"
          android:background="#ffffff"
          /&gt;
  
      &lt;ImageButton
          android:id="@+id/main_btn_2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignTop="@+id/main_btn_1"
          android:layout_marginRight="56dp"
          android:background="#000000"
          /&gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/main_btn_1"
          android:layout_below="@+id/main_btn_1"
          android:textColor="#00aeed"
          android:textStyle="normal" /&gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/textView1"
          android:layout_alignBottom="@+id/textView1"
          android:layout_alignLeft="@+id/main_btn_2"
          android:textColor="#ea1d24"
          android:textStyle="normal" /&gt;
  
      &lt;ImageButton
          android:id="@+id/main_btn_3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView1"
          android:layout_below="@+id/textView1"
          android:layout_marginTop="42dp"
          android:background="#000000"
          /&gt;
  
      &lt;TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/main_btn_3"
          android:layout_below="@+id/main_btn_3"
          android:textColor="#f7941d"
          android:textStyle="normal" /&gt;
  
      &lt;ImageButton
          android:id="@+id/main_btn_4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView2"
          android:layout_alignTop="@+id/main_btn_3"
          android:background="#000000"
           /&gt;
  
      &lt;TextView
          android:id="@+id/textView4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/main_btn_4"
          android:layout_below="@+id/main_btn_4"
          android:textColor="#f7941d"
          android:textStyle="normal" /&gt;
  
      &lt;ImageButton
          android:id="@+id/main_btn_5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView4"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="12dp"
          android:background="#000000"
          /&gt;
  
      &lt;TextView
          android:id="@+id/textView5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/main_btn_5"
          android:layout_centerHorizontal="true"
          android:gravity="center_horizontal"
          android:textColor="#0065b3"
          android:textStyle="normal" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>