title: How to fix the position of views in an Android layout?
body: <p>I have designed a layout with some views (listview, buttons etc..).
  When I install my app into an Android phone, the position of views is not the same as I designed.
  Some buttons are only partially visible. Can anyone please tell me how to fix the position of views in the layout?
  here is the code I used to design.</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="fill_parent" android:layout_height="fill_parent"
      android:background="@drawable/bg4" android:orientation="vertical"
      android:scrollbarAlwaysDrawVerticalTrack="true"&gt;
  
      &lt;LinearLayout android:id="@+id/linearLayout1"
          android:layout_width="fill_parent" android:layout_height="10dp"
          android:orientation="horizontal"&gt;
  
          &lt;TextView android:id="@+id/textView1"
              android:layout_width="wrap_content"
              android:layout_height="3dp" android:text=" " /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:orientation="horizontal"&gt;
  
          &lt;ImageView android:id="@+id/imageView1"
              android:layout_width="100dp" android:layout_height="60dp"
              android:src="@drawable/logo" /&gt;
  
          &lt;TextView android:id="@+id/Loginas"
              android:layout_width="120dp" android:layout_height="wrap_content"
              android:layout_gravity="bottom"
              android:layout_marginBottom="3dp"
              android:layout_marginLeft="3dp" android:gravity="center"
              android:text="Logged in as..." android:textColor="#802A2A"
              android:textSize="18dp" android:typeface="serif" /&gt;
  
          &lt;Button android:id="@+id/btnlgout"
              android:layout_width="80dp" android:layout_height="30dp"
              android:layout_gravity="bottom"
              android:layout_marginLeft="5dp"
              android:layout_marginRight="5dp" android:background="@drawable/logout"
              android:onClick="logout" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout android:id="@+id/linearLayout2"
          android:layout_width="wrap_content" android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:layout_marginTop="20dp" android:orientation="horizontal"&gt;
  
          &lt;TextView android:id="@+id/count"
              android:layout_width="90dp" android:layout_height="25dp"
              android:layout_marginLeft="5dp" android:layout_weight="1"
              android:text="Count : 4" android:textColor="#802A2A"
              android:textSize="15dp" /&gt;
  
          &lt;Spinner android:id="@+id/refresh"
              android:layout_width="150dp" android:layout_height="25dp"
              android:background="@drawable/drop" /&gt;
  
          &lt;Button android:id="@+id/btnpreferences"
              android:layout_width="90dp" android:layout_height="30dp"
              android:layout_marginLeft="10dp" android:background="@drawable/pref"
              android:onClick="getPreferences" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:layout_marginTop="20dp" android:gravity="center_horizontal"
          android:orientation="vertical"&gt;
  
          &lt;LinearLayout android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:orientation="horizontal"&gt;
  
              &lt;TextView android:id="@+id/column1"
                  android:layout_width="70dp" android:layout_height="wrap_content"
                  android:text="column1" android:textStyle="bold" /&gt;
  
              &lt;TextView android:id="@+id/column2"
                  android:layout_width="70dp" android:layout_height="wrap_content"
                  android:text="column2" android:textStyle="bold" /&gt;
  
              &lt;TextView android:id="@+id/column3"
                  android:layout_width="70dp" android:layout_height="wrap_content"
                  android:text="column3" android:textStyle="bold" /&gt;
  
              &lt;TextView android:id="@+id/column4"
                  android:layout_width="70dp" android:layout_height="wrap_content"
                  android:text="column4" android:textStyle="bold" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;ListView android:id="@+id/listViewTickets"
              android:layout_width="match_parent"
              android:layout_height="200dp" android:layout_gravity="center_horizontal"
              android:layout_marginTop="10dp"&gt;
          &lt;/ListView&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout android:id="@+id/linearLayout1"
          android:layout_width="wrap_content" android:layout_height="wrap_content"
          android:layout_weight="1" android:orientation="horizontal"&gt;
  
          &lt;TextView android:id="@+id/textView1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:text=" " /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:layout_marginBottom="80dp" android:orientation="horizontal"&gt;
  
          &lt;Button android:id="@+id/btnNew"
              android:layout_width="80dp" android:layout_height="30dp"
              android:background="@drawable/btnnew" /&gt;
  
          &lt;Button android:id="@+id/btnUpdate"
              android:layout_width="80dp" android:layout_height="30dp"
              android:layout_marginLeft="10dp"
              android:layout_marginRight="10dp" android:background="@drawable/edit" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>