It seems there is a padding between the bottom input section and bottom margin of an edittext by default. I have a linearlayout(horizon) including one edittext and one button. I just can’t make them in one single line perfectly, since the padding between the bottom input section and bottom margin make the edittext lower than the button through I set the same height and alignment for them.
I also tried Relative layout but cannot solve the problem either, here is my layout
<RelativeLayout
android:id="@+id/SearchLinearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginTop="10dp" >
<EditText
android:id="@+id/FilterEditText"
android:layout_width="fill_parent"
android:layout_height="38dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/SearchButton"
android:gravity="center_vertical"
android:hint="@string/search_or_add_a_place"
android:imeOptions="flagNoExtractUi"
android:inputType="text|textNoSuggestions"
android:textSize="15dp" />
<Button
android:id="@+id/SearchButton"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_alignParentRight="true"
android:background="@drawable/search_btn"
android:enabled="false"
android:gravity="center_vertical" />
</RelativeLayout>
changing the background of editText can solve my problem