There is a certain layout, here is his piece:

enter image description here

In fact, there are two questions, but one comes out of the second: How the caption is made over the first EditText (specifically hml or method, I know that through TextInputLayout is done).

The second is how to make a TextInputLayout for, for example, a spinner ?

    1 answer 1

    You place EditText in TextInputLayout and all. The inscription is done by itself, specify the androi:hint attribute for it or for EditText (you can use the associated setHint() method for both of them).
    At the same time, in the inactive widget the inscription will be in the input field, when the focus moves to it, the inscription will shift upwards.

     <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="@string/form_username"/> </android.support.design.widget.TextInputLayout> 

    Read more about the widget.

    You can also use TextInputEditText from the Design support library as a nested widget instead of EditText , which fixes a bug with a hint when using full-screen input mode

    For spinner make third-party libraries .