5

enter image description here

can anyone know how to make this?

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

thanks in advance

Lester1992
  • 493
  • 2
  • 9
  • 20

2 Answers2

7

Try this out :

<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 it helps.

Armand
  • 23,463
  • 20
  • 90
  • 119
Abhishek Sabbarwal
  • 3,758
  • 1
  • 26
  • 41
1

Also you can use the 'hint' property: android:hint="@string/hint_email"

Then, the text label is ignored when you input a value.

For setting color of hint texts, see stackoverflow here

Bruno L.
  • 457
  • 6
  • 8