-1

ここに画像の説明を入力

Android Things デバイスで漢字を使用すると、テキストが文字化けします。

4

2 に答える 2

0

漢字をサポートするフォントを選択する必要があります。

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

DroidSans.tffファイルは、assets フォルダーに配置する必要があります

于 2016-12-24T09:42:56.293 に答える
0

私はこの方法で解決します。

コード

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

資源

フォントファイルの場所

于 2017-08-08T04:41:26.650 に答える