如何在TextView中通过Unicode设置表情符号?

嗨,我想做以下事情:


??? unicode = U+1F60A

String emoji = getEmojiByUnicode(unicode)

String text = "So happy "

textview.setText(text + emoji);

在我的textview中得到这个:


很高兴happy


我该如何实施getEmojiByUnicode(unicode)?


unicode变量应为哪种类型?(字符串,字符,整数?)


请注意,我不想使用Drawables!


莫回无
浏览 820回答 3
3回答

翻阅古今

注意:对于Kotlinfun getEmoji(unicode: Int): String {    return String(Character.toChars(unicode))}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android