How to change the floating label color of TextInputLayout

前端 未结 25 1765
[愿得一人]
[愿得一人] 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:36

    Instead of Brahmam Yamani answer I prefer to use Widget.Design.TextInputLayout as parent. That ensures, that all required items are present, even if not all items are overwritten. In Yamanis answer, the app will crash with an unresolvable resource, if setErrorEnabled(true) is called.

    Simply change the style to the following:

    
    

提交回复
热议问题