How to set multiple colors to a floating Edittext's hint?

我是研究僧i 提交于 2019-12-08 02:27:44

问题


Is there a way to set multiple colors to the edittext's hint when wrapped by android.support.design.widget.TextInputLayout without compromising the behaviour of floating edittexts?

AFAIK The only way to set multiple colors to the edittext hint is by using SpannableStringBuilder. But when the editext is wrapped by TextInputLayout and the hint set programmatically using a SpannableStringBuilder, it behaves like a normal editext which does not float (the labels aren't floating)

Whereas if the hint is set through the xml it works as a floating edittext but in this case the hint would be single colored

I am looking for a way to add multiple colors to the edittext while the floating labels work intact.

来源:https://stackoverflow.com/questions/35551570/how-to-set-multiple-colors-to-a-floating-edittexts-hint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!