【发布时间】:2019-03-01 00:57:32
【问题描述】:
我正在使用 api 并从我得到的 json 对象创建一个天气应用程序
{"success":true,"temp":"14","picto":"meteo_32","icon":"\uf00d;","unite":"C","frequence":"4 "}
我用的是图片的字体:
所以我将字符串添加到 android studio 中的项目目录中,这是我的代码:
JSONObject jObj = new JSONObject(responseContent);
String icon = String.valueOf(jObj.get("icon"));
weatherFont = Typeface.createFromAsset(getAssets(),"fonts/weathericons_regular_webfont.ttf");
imageMTO.setTypeface(
icon = icon.replace("\\u", "&#x");
imageMTO.setText(icon);
但我得到了 uf00d;当我运行应用程序时在 textView 上
谁能帮帮我?
【问题讨论】: