In the above image how can I horizontally center the "Label" ?
Asked
Active
Viewed 252 times
0
-
You can use this, maybe it's your answer ? https://www.titanwolf.org/Network/q/296c80a4-0750-4a93-b40c-eed1749ce93d/y – vincent091 Oct 25 '21 at 18:59
-
^That's scraped from https://stackoverflow.com/questions/53413119/outlinedbox-textinputlayout-and-gravity-center. Just FYI. – Mike M. Oct 25 '21 at 19:02
1 Answers
1
<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>

Alireza Abbasian
- 99
- 4