问题资产的文件夹 [英] Issue in the Assets folder

查看:156
本文介绍了问题资产的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,即一个字体没有工作,它给了我一个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.

这篇关于问题资产的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆