Multiple hints or multiple style for the same hint in edittext

两盒软妹~` 提交于 2019-12-06 14:49:45

There is only one hint attribute to EditText although you can add multi-colored hint programmatically like this

myEditView.setHint(Html.fromHtml("city - <font color='blue'>tap to select a city</font>."));

EDIT: if you are taking values from string.xml and color.xml then do following:

myEditView.setHint(Html.fromHtml(getString(R.string.hint1)+" <font color='"+getResources().getColor(R.color.hintColor)+"'>"+getString(R.string.hint2)+"</font>."));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!