本文介绍了问题资产的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个问题,即一个字体没有工作,它给了我一个FC。所以我把字体文件到SD卡,并在字体和工作的字体采用CreateFromFile!结果这里是code我使用的资产文件夹:
I had an issue where a font didnt work and it gave me a FC. So I put the font file into the sdcard, and used CreateFromFile in the typeface and the font worked! Here is the code I used for the Assets folder:
holder.tv_SuraName =(TextView)convertView.findViewById(R.id.Start_Name); holder.tv_SuraName.setTypeface(Typeface.createFromAsset(mContext.getAssets(), "suralist_font.ttf"));但我改变了code这和它的工作:
But I changed the code to this and it worked:
holder.tv_SuraName = (TextView)convertView.findViewById(R.id.Start_Name); Typeface Font = Typeface.createFromFile(new File(Environment.getExternalStorageDirectory()+"/asd.ttf"));这是否意味着我必须在资产文件夹有问题?我该如何解决这个问题?谢谢
Does this mean I have a problem in the Assets folder? How can I fix this? Thanks
推荐答案看到
Typeface font0 = Typeface.createFromAsset(getAssets(),"fonts/AmericanDream.ttf"); tv1.setTypeface(font0);下面的字体(在资产的文件夹)包含AmericanDream.ttf文件夹里面。像:资产 - >字体 - > AmericanDream.ttf我希望这将帮助ü。
here fonts (folder in assets) folder containing AmericanDream.ttf file inside. like:assets-->fonts-->AmericanDream.ttf i hope this will help u.
更多推荐
问题资产的文件夹
发布评论