I want the floating label position to be centre align. I searched a lot but didn't get any solution.
Please help me.
I want the floating label position to be centre align. I searched a lot but didn't get any solution.
Please help me.
Try this:
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="email"
android:gravity="center"
/>
</android.support.design.widget.TextInputLayout>
Hi have you tried setting textAlignment and gravity properties...give them a try
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textAlignment="center">
<EditText
android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:hint="@string/hint_name" />
</android.support.design.widget.TextInputLayout>
hope this helps..
Set the align on the gravity, on android:gravity="center_horizontal". So it could be:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:gravity="center_horizontal"
android:hint="your hint" />
Hope this helps.