Typeface.createFromAsset(AssetManager mgr,String path); 怎么用呢?
AssetManager mgr;
tf = Typeface.createFromAsset(mgr, font);
TextView txtName = (TextView) convertView.findViewById(R.id.txtTitle);
txtName.setText(novena.getName());
txtName.setTypeface(tf);
如何初始化mgr?
你可以用 tf = Typeface.createFromAsset(context.getAssets(),font);答案 0 :(得分:5)
像这样:
AssetManager mgr;
...
mgr = getAssets();
答案 1 :(得分:5)
//If you are inside of an ACtivity, and NOT inside of an inner class
AssetManager mgr = getAssets();