我在http://blog.csdn.net/weiguishan/article/details/46678935这边博客谢了两种方法,自定义textview字体,在xml里面大量引用会卡顿,下面给出解决办法。
首先写一个类,继承Application,在该类的oncreate方法获取Typeface
public class BusinessApplication extends Application {
public static Typeface texttypeface = null;
public static Typeface digitaltypeface = null;
@Override
public void onCreate() {
//生成字体库文件
texttypeface = Typeface.createFromAsset(getApplicationContext().getAssets(),"fonts/weiruanyahei.ttf");