Imagebutton layout_center_inparent problem
<p>i am having a problem with my imagebutton it does not align right when i specify the centerinparent.</p>

<pre><code>&lt;LinearLayout
        android:layout_width="match_parent" android:layout_marginTop="4dp"
        android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
        android:layout_height="50dp" android:background="#FF0000"&gt;

        &lt;RelativeLayout android:layout_height="match_parent"
            android:layout_width="40dp" android:background="#0000FF"&gt;
            &lt;ImageView android:id="@+id/imgType"
                android:layout_centerInParent="true" android:layout_width="wrap_content"
                android:src="@drawable/type_text" android:layout_height="wrap_content" /&gt;
        &lt;/RelativeLayout&gt;

        &lt;RelativeLayout android:layout_height="match_parent"
            android:layout_width="match_parent" android:layout_weight="1"&gt;
            &lt;LinearLayout android:orientation="vertical"
                android:layout_height="match_parent" android:layout_width="match_parent"&gt;
                &lt;TextView android:layout_width="match_parent"
                    android:textColor="#686a68" android:layout_height="match_parent"
                    android:textSize="15dp" android:text="Manifest : Text"
                    android:ellipsize="end" android:singleLine="true"
                    android:layout_weight="1" /&gt;

                &lt;TextView android:layout_width="match_parent"
                    android:textColor="#686a68" android:layout_height="match_parent"
                    android:textSize="15dp" android:id="@+id/txtTitle" android:text="[TEXT NAME]"
                    android:layout_weight="1" android:singleLine="true"
                    android:ellipsize="end" /&gt;
            &lt;/LinearLayout&gt;
        &lt;/RelativeLayout&gt;

        &lt;RelativeLayout android:layout_height="match_parent"
            android:layout_width="60dp" android:background="#00FF00"&gt;
            &lt;ImageButton android:src="@drawable/type_text"
                android:layout_height="48dp" android:layout_centerInParent="true"
                android:layout_width="48dp" android:id="@+id/butEdit" /&gt;
        &lt;/RelativeLayout&gt;

    &lt;/LinearLayout&gt;
</code></pre>

<p><a href="http://img859.imageshack.us/i/layouta.png/" rel="nofollow">image</a></p>

<p>As you can see the vertical alignment of the imagebutton is not right.</p>

<p>why is it doing this.</p>
