加载新自定义字体的 方法

1. Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), "fonts/huawenxingkai.ttf");

if(convertView instanceof TextView) {
((TextView) convertView).setTypeface(mTypeface);
((TextView) convertView).setTextSize(24);
((TextView) convertView).setGravity(Gravity.CENTER);
((TextView) convertView).setTextColor(mContext.getResources().getColor(R.color.common_black));
((TextView) convertView).setHeight(itemHeight);
}

2. Typeface mTypeface = Typeface.create("ltxh", Typeface.NORMAL);

posted on 2016-12-13 11:41  小小鸟儿!  阅读(196)  评论(0编辑  收藏  举报