Reputation: 493
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
Upvotes: 5
Views: 5780
Reputation: 525
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
Upvotes: 1
Reputation: 3808
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.
Upvotes: 7