【发布时间】:2014-05-01 21:30:06
【问题描述】:
我知道我们可以使用Typeface 更改编辑文本字体。但是我们为编辑文本设置的错误呢?
看下面的代码:
Typeface font = Typeface.createFromAsset(getAssets(), "fonts/ATaha.ttf");
private EditText mPasswordView;
mPasswordView = (EditText) findViewById(R.id.password);
mPasswordView.setTypeface(font);
使用此代码,我只能更改编辑文本字体,但是当我设置如下错误时:
mPasswordView.setError(getString(R.string.error_field_required));
错误提示字体为android默认字体,没有因使用字体而改变。我该如何改变呢?
【问题讨论】:
-
我发现了一个和你类似的问题。 [stackoverflow.com/questions/14413575/…[1]:stackoverflow.com/questions/14413575/…
-
@Andrew 但是唯一讨论的是颜色,没有人提到改变字体,也没有结论!
标签: android android-edittext typeface