Android – change the position of the floating label text for textinputlayout

Floating label text appears at the edge of the EditText box. How to raise it above the predetermined level?

My code:

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_layout_usernameL"
    android:theme="@style/MyTextInputLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/etUsername"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:background="#ffffff"
        android:hint="Username"
        android:padding="10dp"/>


</android.support.design.widget.TextInputLayout>

resolvent:

I happened because of the filling, please check your XML for the following

<android.support.design.widget.TextInputLayout   
android:id="@+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<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> 

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>