1

I want to create a new TextInputLayout dynamically by I must set hintTextAppearance to work correctly.

How can I set hintTextAppearance dynamically?

Eriawan Kusumawardhono
  • 4,796
  • 4
  • 46
  • 49
XDelta
  • 43
  • 2
  • 7
  • possible duplicate of [How to change the floating label color of TextInputLayout](http://stackoverflow.com/questions/30546430/how-to-change-the-floating-label-color-of-textinputlayout) – Risadinha Jun 13 '15 at 14:47

2 Answers2

0

hintTextAppearance will be same as you set Text Appearance of EditText.

Ahmad Nawaz
  • 1,129
  • 7
  • 26
  • editText.setHint does not solve my problem. when i add a TextInputLayout the following error is ocurred: Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 at android.content.res.TypedArray.getColor(TypedArray.java:326) at android.support.design.widget.CollapsingTextHelper.setCollapsedTextAppearance(CollapsingTextHelper.java:166) set hintTextAppearance solve my problem. – XDelta Jun 13 '15 at 14:17
0
        TextInputLayout textInput = findViewById(text input id);
        textInput.setHintTextAppearance(R.style.FloatingHintTextStyle);

       <style name="FloatingHintTextStyle" parent="TextAppearance.Design.Hint">
          <item name="android:textColor">@color/floating_hint_color</item>
       </style>
Qumber Abbas
  • 560
  • 1
  • 4
  • 11