-1

在此处输入图像描述

当我在 Android Things 设备上使用汉字时,文本变得乱码。

4

2 回答 2

0

我这样解决。

代码

TextView txtHello = (TextView)findViewById(R.id.txt_hello);
txtHello.setTypeface(ResourceCompat.getFont(context, R.font.nanum);

资源

字体文件位置

于 2017-08-08T04:41:26.650 回答
0

您必须选择支持中文字符的字体:

TextView myText = (TextView) findViewById(R.id.myText);
myText.setTypeface(Typeface.createFromAsset(getAssets(),
        "DroidSans.ttf"));

DroidSans.tff文件需要放在 assets 文件夹中

于 2016-12-24T09:42:56.293 回答