【问题标题】:display unicode in smart phone?在智能手机中显示unicode?
【发布时间】:2016-11-27 12:48:25
【问题描述】:

这是我的 java 活动

public class word extends Activity implements View.OnClickListener{
EditText et;
Button btnz,btncopy;
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.word);
    et =(EditText)findViewById(R.id.et);
    btnz =(Button)findViewById(R.id.btnz);
    btncopy =(Button)findViewById(R.id.btnc);
    tv =(TextView)findViewById(R.id.tv);
    btnz.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            String a ="a";
            String b ="b";
            String c ="c";
            String d ="d";
            String e ="e";
            String f ="f";
            String g ="g";
            String h ="h";
            String a1 ="\u24B6";
            String b1 ="\u24B7";
            String c1 ="\u24B7";
            String d1 ="\u24B9";
            String e1 ="\u24BB";
            String f1 ="\u24BB";
            String g1 ="\u24BD";
            String h1 ="\u24BD";
            String name =et.getText().toString();
            name =name.replaceAll(a,a1);
            name =name.replaceAll(b,b1);
            name =name.replaceAll(c,c1);
            name =name.replaceAll(d,d1);
            name =name.replaceAll(e,e1);
            name =name.replaceAll(f,f1);
            name =name.replaceAll(g,g1);
            name =name.replaceAll(h,h1);
            tv.setText(name);

当在 avd 中运行并在 edittext 中写入时,它正在工作,但在我的智能手机中运行时,不显示所有内容 我非常努力并在互联网上搜索。 什么是解决方案? 对不起我的语法请不要解雇

【问题讨论】:

    标签: java android xml unicode smartphone


    【解决方案1】:

    除非您使用的字体具有该字符的字形,否则该字符将永远不会显示在屏幕上。检查 TextView 使用的是什么字体,然后找出该字体是否包含像 "\u24B6" 这样的字符的字形(圆圈 A = Ⓐ)。如果没有,您将需要使用不同的字体。

    【讨论】:

    • @p.karimdost:欢迎来到 S.O.你能为你的评论链接提供一些上下文吗?该链接指向另一个网站上有关复制带有字体的文本的问题,可能由您发布。那里有一个答案指向关于 ClipData 的文档。那么结果证明使用正确的字体确实是问题所在吗?如果我的回答是正确的并引导您找到解决方案,请考虑通过单击复选标记接受它。
    猜你喜欢
    • 2015-02-01
    • 2012-04-07
    • 1970-01-01
    • 1970-01-01
    • 2016-02-09
    • 1970-01-01
    • 2016-11-09
    • 1970-01-01
    • 2017-09-21
    相关资源
    最近更新 更多