1

I have a TextInputLayout in my layout and i want use html tag or spannable in it's hint but it does not work with it.

I search all links in google but the result was "it's not possible now and maybe in next version and updates be possible".

is it possible customize TextInputLayout view to accept html tag in hint? and how can i do this?

hamed
  • 148
  • 11

1 Answers1

3

Add below code in layout xml file for TextInputLayout:

<android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/activity_horizontal_margin"
        app:hintAnimationEnabled="false">

        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
              android:hint="@string/enter_message" />

    </android.support.design.widget.TextInputLayout>

In string.xml file add following code:

<string name="enter_message">Enter Message<font fgcolor="red">*</font></string>
pooja londhe
  • 144
  • 2