title: Align ImageView with EditText horizontally
body: <p>I'm trying hard to find a way of aligning an <code>EditText</code> and an <code>ImageView</code> <strong>properly</strong> on Android. I keep getting this result:</p>
  
  <p><img src="https://i.stack.imgur.com/cCdWV.png" alt="enter image description here"></p>
  
  <p>The XML part is quite simple:</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;ImageView
          android:id="@+id/image"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:gravity="center"
          android:scaleType="centerInside"
          android:src="@drawable/android"
          android:visibility="gone" /&gt;
  
      &lt;EditText
          android:id="@+id/edittext"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:singleLine="true" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I've also tried many of the suggestions below, including PravinCG's (RelativeLayout with alignTop/alignBottom):</p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:gravity="center_vertical"
      android:orientation="horizontal" &gt;
  
      &lt;ImageView
          android:id="@+id/image"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/edittext"
          android:layout_alignTop="@+id/edittext"
          android:scaleType="centerInside"
          android:src="@drawable/android"
          android:visibility="visible" /&gt;
  
      &lt;EditText
          android:id="@+id/edittext"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_toRightOf="@id/image"
          android:hint="@string/username"
          android:singleLine="true" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>But the result is exactly the same.</p>
  
  <p>I've tried playing with the EditText's background padding, intrinsic height, but to no avail.</p>
  
  <p>The EditText's background drawable is different among Android versions/ROMs, and I want to support them all.</p>
  
  <p>How can I make this alignment <strong>pixel perfect</strong> on any android version (and style)?</p>