Android EditText文本不是垂直居中的

Pau*_*est 3 android android-edittext

我有一个定义EditBox的搜索栏

<EditText
    android:id="@+id/search_editbox"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_centerVertical="true"
    android:layout_toLeftOf="@id/search_execute_imageview"
    android:layout_toRightOf="@id/layout_back_logo"
    android:gravity="left"
    android:hint="@string/search_hint"
    android:maxLength="20"
    android:textCursorDrawable="@null"
    android:drawableRight="@drawable/abc_ic_clear_holo_light"
    android:background="@drawable/rounded_edittext_states"
    android:padding="5dip"        
    android:singleLine="true"
    android:textSize="@dimen/main_text_size" />
Run Code Online (Sandbox Code Playgroud)

尽管android:layout_centerVertical="true"文字不在中间,但更接近上方.

在此输入图像描述

gio*_*gio 10

使用

 android:gravity="left|center_vertical"
Run Code Online (Sandbox Code Playgroud)