-12

When I am using a data binding library within a tab layout the EditText hint does not hide after typing.

<layout> <Edittext hint='enter your text'/> <layout>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
chavanNil
  • 161
  • 2
  • 4

4 Answers4

1

Try this code

<EditText
  android:id="@+id/reg_edu_edittext"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_gravity="center"
  android:inputType="textPersonName"
  android:hint=" Educational Qualification"
  android:layout_marginTop="5dp" />
Derek Wang
  • 10,098
  • 4
  • 18
  • 39
0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

        <EditText
            android:hint="Caption..."
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="#ffffff"
            android:textSize="20sp"/>
</RelativeLayout>
Edijae Crusar
  • 3,473
  • 3
  • 37
  • 74
-1

Try following code:

<layout>
<data>
    <variable
        name="user"
        type="com.project.User" />
</data>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <EditText
        android:id="@+id/phone_number"
        android:text="@{user.userName}"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:hint="phone number" />
</LinearLayout>

Mrunal
  • 348
  • 4
  • 15
-1

May this link will help you to add hint in Edittext and also u will get code to remove it when user enter something in it with EditText hint color style. Check it..

Android EditText Hint

Community
  • 1
  • 1