android - 如何在Android中显示如下面孔

标签 android

我有以下角色:༼つ◕_◕༽つ

它在 strings.xml 中是这样的:

<string name="faceIcon_5">༼ つ ◕_◕ ༽つ</string>

和 Android Studio,似乎可以很好地显示角色。

然而,当它实际在手机上运行时,它看起来像这样:

enter image description here

好像有些字符不能被android显示。我能做什么?

最佳答案

您必须允许其中一些字符使用 unicode。

// Your Text View.
tv=(TextView)findViewById(R.id.textView1);
// Get A Unicode Font
Set a unicode font to your textview. Via TypeFace font = typeface.createfromasset(getassets(), someUNIcodeFont):
// set The font to your font
tv.setTypeface(font); 
//set face to textview.
tv.setText(R.String.faceIcon_5);

关于android - 如何在Android中显示如下面孔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36927485/

相关文章:

android - 以编程方式修改 ActionBarDrawerToggle Drawable

android - 三星设备忽略 webview 自定义字体

android - 如何为 Android 13 请求推送通知权限?

android - findViewById 不适用于包含?

android - 在 React Native Android 中的屏幕之间导航?

android - ListView 中的多个 TextView?

android - 当设备连接到 Internet 时向服务器发送数据

Java,如何在远程主机中创建新目录。

java - 安卓 :Activity is blocking with black screen when it occur Exception

java - Nexus 7 与 Eclipse 的问题