如何在 TextInputLayout 中水平居中 "Label hint"?
How to horizontally center "Label hint" in TextInputLayout?
Image of textinputlayout
在上图中如何将“标签”水平居中?
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/inputAddress"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:hint="@string/postal_address"
android:textSize="@dimen/_10sdp"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="adas"
android:textSize="@dimen/_10sdp" />
</com.google.android.material.textfield.TextInputLayout>
Image of textinputlayout
在上图中如何将“标签”水平居中?
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/inputAddress"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:hint="@string/postal_address"
android:textSize="@dimen/_10sdp"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="adas"
android:textSize="@dimen/_10sdp" />
</com.google.android.material.textfield.TextInputLayout>