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>
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>
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" />
<?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>
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>
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..