title: Android Layout left and right align in horizontal layout
body: <p>I am have a ImageView and a ImageButton. I have them next to each other in a horizontal layout. I am trying to make it so that the image is left aligned on the screen, and the button is right aligned. I have tried setting gravity but it doesnt seem to make a difference. Where am I going wrong?</p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/linearLayout1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" 
      &gt;
  
      &lt;ImageView
          android:id="@+id/imageView1"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="left"
          android:layout_weight="1"
          android:gravity="left"
          android:src="@drawable/short_logo" /&gt;
  
      &lt;ImageButton
          android:id="@+id/terminateSeed"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="right"
          android:background="@null"
          android:src="@drawable/unregister_icon" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>