How to change the floating label color of TextInputLayout

前端 未结 25 2104
[愿得一人]
[愿得一人] 2020-11-22 15:03

With reference to the new TextInputLayout released by Google, how do I change the floating label text color?

Setting colorControlNormal,

25条回答
  •  梦谈多话
    2020-11-22 15:31

    This is simple but the developer gets confused due to multiple views having the same attributes in different configurations/namespaces.

    In the case of the TextInputLayout we have every time a different view and with params either with TextInputEditText or directly to TextInputLayout.

    I was using all the above fixes: But I found that I was using

                    app:textColorHint="@color/textcolor_black"
    

    actually i should be using

                    android:textColorHint="@color/textcolor_black"
    

    As an attribute of TextinputLayout

    textcolor_black.xml

    
    
        
        
        
        
    
    

提交回复
热议问题