在android开发中添加外挂字体

1.在项目目录中,右键app——New——Folder—— Assets Folder

2.把.ttf或者.oft文件拷进这个assets文件夹

3.在onCreate()中

Typeface typeface = Typeface.createFromAsset(getAssets(), "TpldKhangXiDictTrial.otf");//加入外挂字体
Button button = (Button)findViewById(R.id.button_start);
button.setTypeface(typeface);

搞定~

posted @ 2015-10-28 10:49  龟窝  阅读(246)  评论(0编辑  收藏  举报