【发布时间】:2015-08-05 06:37:08
【问题描述】:
我需要根据下图为 textview 设置文本样式
使用的字体是 CARTER ONE 字体
这是我的文本视图类
public class CustomTextViewCarter extends TextView {
private static Typeface mTypeface;
public CustomTextViewCarter(final Context context) {
this(context, null);
}
public CustomTextViewCarter(final Context context, final AttributeSet attrs) {
this(context, attrs, 0);
}
public CustomTextViewCarter(final Context context, final AttributeSet attrs, final int defStyle) {
super(context, attrs, defStyle);
if (!isInEditMode()) {
if (mTypeface == null) {
mTypeface = Typeface.createFromAsset(context.getResources().getAssets(), "carter_one.ttf");
}
setTypeface(mTypeface);
}
}
}
但没有出现相同类型的文本。怎么办?
【问题讨论】:
-
你可以使用 github.com/chrisjenx/Calligraphy 库
标签: android fonts textview styles stroke