Android 如何在TextInputLayout中垂直居中绘制?

Android 如何在TextInputLayout中垂直居中绘制?,android,material-design,android-textinputlayout,material-components,material-components-android,Android,Material Design,Android Textinputlayout,Material Components,Material Components Android,我在TextInputLayout的左侧添加了一个drawable(如下面的TextInputInputText所示),并希望在其下方添加一些填充,使其垂直居中于其父级。是否有此命令或解决方法 <com.google.android.material.textfield.TextInputLayout android:id="@+id/contact_first_name_input_text" android:layout_

我在TextInputLayout的左侧添加了一个drawable(如下面的TextInputInputText所示),并希望在其下方添加一些填充,使其垂直居中于其父级。是否有此命令或解决方法

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/contact_first_name_input_text"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:hint="@string/contact_first_name"
                android:layout_marginEnd="8dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/contactFirstName"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPersonName|textCapWords"
                    android:drawableStart="@drawable/ic_person_black_24dp"
                    android:drawablePadding="8dp"
                    />

使用
文本输入布局中的
app:startIconDrawable
属性添加可绘制的:

<com.google.android.material.textfield.TextInputLayout
       app:startIconDrawable="@drawable/..."

使用
文本输入布局中的
app:startIconDrawable
属性添加可绘制的:

<com.google.android.material.textfield.TextInputLayout
       app:startIconDrawable="@drawable/..."

谢谢你,加布里埃尔,我犯了一个错误,在TextInputItemText中使用了android:DrawableStart!谢谢你,Gabriele,我犯了一个错误,在TextInputText中使用了android:DrawableStart!