Android EditText提示使用与EditText相同的字体 [英] Android EditText hint uses the same font that the EditText has
问题描述
我已经为EditText定义了一个字体,现在EditText提示也显示了该字体,但我需要为EditText提示使用不同的字体,有没有办法实现这个?
I have defined a font for a EditText and now the EditText hint also shows that font, but i need to use a different font for EditText hint, is there a way to achieve this?
推荐答案
Android EditText提示使用与EditText相同的字体
Android EditText hint uses the same font that the EditText has
EditText使用 textview_hint
布局来显示 ErrorPopup
popup message.so尝试设置不同的字体提示为:
EditText uses textview_hint
layout to show ErrorPopup
popup message.so try as to set different typeface for Hint as:
LayoutInflater inflater = LayoutInflater.from(<Pass context here>);
TextView hintTextView = (TextView) inflater.inflate(
com.android.internal.R.layout.textview_hint, null);
hintTextView.setTypeface(< Typeface Object>);
编辑:
因为 EdiText
使用 ErrorPopup
在内部显示Hint弹出窗口。
Because EdiText
internally show Hint popup using ErrorPopup
.
有关更多帮助,请参阅以下链接:
See following link for more help:
这篇关于Android EditText提示使用与EditText相同的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!