2

I am using floatlabelededittext in my application. My requirement is to set 2 different fonts for hint and text. Is it possible? Then how?

andro-girl
  • 7,989
  • 22
  • 71
  • 94

2 Answers2

0

To have 2 different fonts for text and hint you need to use custom TypefaceSpan.

  • Set a font to a text by using usual setTypeface method
  • Set a font to a hint by using SpannableString

I already answered to that question Android EditText hint uses the same font that the EditText has

You can also keep the same font and change the hint's size and style independently. To know how, please, see my answer here

Ayaz Alifov
  • 8,334
  • 4
  • 61
  • 56
-1

I don't think it is possible right now. But if you look at the source code of floatlabeledittext here https://github.com/wrapp/floatlabelededittext/blob/master/library/src/com/wrapp/floatlabelededittext/FloatLabeledEditText.java you see that it will be easy to add such feature.

All you need to do is to use setTypeface on the hint label mHintTextView.

sonic
  • 1,894
  • 1
  • 18
  • 22