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 .