Edittext Android Studio

Asked

Viewed 445 times

0

I Have Next Edittext:

<EditText
    android:layout_width = "match_parent"
    android:layout_height = "wrap_content"
    android:id = "@+id/textSenha"
    android:layout_marginTop="40dp"
    android:hint = "@string/senha"
    android:textCursorDrawable = "@drawable/cursor"
    android:backgroundTint = "@color/black"
    android:inputType = "textCapWords"/>

seguinte resutado: my next question, how do I get it to stay that way? User select field hint password it suffers elevation

inserir a descrição da imagem aqui

  • https://github.com/rengwuxian/MaterialEditText

1 answer

2


You need to make a wrap of your EditText with a TextInputLayout ( documentation ).

 <android.support.design.widget.TextInputLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content">

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

To maintain compatibility it would be good to use the design support library. Add to graddle

 compile 'com.android.support:design:23.0.0'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.