How to set TextInputLayout error message colour?

前端 未结 9 2217
旧巷少年郎
旧巷少年郎 2020-11-27 13:58

How can I change the colour of the error message that can be set to appear below the text field in a TextInputLayout (via setError(...) – see error

9条回答
  •  清歌不尽
    2020-11-27 14:46

    Actually, to change just the error message color, you can set textColorError in your theme (and also set colorControlNormal and colorControlActivated for the general widget and hint text color). TextInputLayout picks up that attribute. NOTE: if you set errorTextAppearance to a custom style then textColorError will have no effect.

    
    

    And in your AndroidManifest.xml:

    
    
        
    
    
    

提交回复
热议问题