title: Make two relative layout float right and left
body: <p>i have a simple question.
  I have made two relative layout , one contains image, other contains text.
  I want them to float to left and right respectively.
  Image layout should take 40% width whereas the text layout should have 60%.</p>
  
  <p>How can i acheieve this?
  My xml code</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="wrap_content"
      android:orientation="vertical"
      android:padding="10dp"
      android:paddingLeft="10dp"
      android:paddingRight="10dp"
      android:background="#cccccc"&gt;
  
      &lt;!-- Name Label --&gt;
      &lt;RelativeLayout
          android:layout_width="wrap_content"
          android:layout_height="150dp"
          android:layout_gravity="right"
          android:background="#eaeaea"&gt;
          &lt;ImageView
              android:layout_width="150dp"
              android:layout_height="wrap_content"
              android:id="@+id/img"
              android:src="@drawable/mike"/&gt;
  
  
      &lt;/RelativeLayout&gt;
      &lt;RelativeLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="left"
          android:background="#fa6800"&gt;
          &lt;TextView
              android:id="@+id/email"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:paddingBottom="2dip"
              android:textColor="#acacac"
              android:text="email"
              android:textStyle="bold"
              /&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Hello This is testing"
              android:id="@+id/guid"
              android:visibility="gone"/&gt;
  
          &lt;TextView
              android:id="@+id/name"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:paddingBottom="2dip"
              android:paddingTop="6dip"
              android:textColor="#43bd00"
              android:text="name:"
              android:textStyle="bold"
              android:visibility="gone"/&gt;
  
          &lt;!-- Email label --&gt;
  
          &lt;!-- Mobile number label --&gt;
          &lt;TextView
              android:id="@+id/mobile"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:gravity="left"
              android:text="Mobile: "
              android:textColor="#5d5d5d"
              android:maxLines="1"/&gt;
  
      &lt;/RelativeLayout&gt;
  
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>