有没有办法使用com.android.support:support-emoji:28.0.0在Android上的TextView上获取表情符号iOS
我想避免那个开源库...请帮忙吗?谢谢
你可以使用unicode表情符号。
这是链接:https://unicode.org/emoji/charts/full-emoji-list.html
要在Android中使用它,您需要将U +替换为0x,因此它将是一个整数。
要将unicode设置为TextView
中的文本,您可以使用;
Java的:
public String createEmoji(int unicode){
return new String(Character.toChars(unicode));
}
科特林:
fun createEmoji(unicode: Int): String {
return String(Character.toChars(unicode))
}