问题资产的文件夹

编程入门 行业动态 更新时间:2024-10-28 00:28:27
本文介绍了问题资产的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

更多推荐

问题资产的文件夹

本文发布于:2023-07-12 07:26:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1096856.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   资产

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!