Edit text tagged inside in android

enter image description here

Does anyone know how to do this?

I think this is editText but how can I put the label and text at the same time?

early

+4
source share
2 answers

Try the following:

<FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="40dp" > <requestFocus /> </EditText> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:paddingLeft="10dp" android:text="Gender" /> </FrameLayout> 

Hope this helps.

+5
source

You can also use the "hint" property: Android: hint = "@ string / hint_email"

Then the text label is ignored when entering the value.

To set the color of the hint text, see fooobar.com/questions/43272 / ...

0
source

All Articles