使用 unicode '\u221B' 的文本视图中不显示立方根符号

Cube root symbol not show in textview using unicode '\u221B'

我想使用 Unicode \u221B 在 android textview 中显示立方根符号。 它不显示在 textview 上,但显示在日志购物车中。

TextView txtcube_sqrt = (TextView) findViewById(R.id.txtcube_sqrt);
txtcube_sqrt.setText("\u221B");

如果我使用 Unicode '\u221A' 作为平方根,它可以正常工作。

请有人帮我解决这个问题。

谢谢

只需像这样设置此符号:

yourTextView.setText(String.valueOf('\u221B'));

 yourTextView.setText(Character.toString('\u221B'));

发生这种情况的原因通常是所使用的字体可能不支持 unicode 字符。使用支持所需 unicode 字符的字体,你应该很高兴。有关详细信息,请阅读 this