android在静态布局中显示点字符

android在静态布局中显示点字符,android,ascii,Android,Ascii,我想显示一个点字符\u2022 在自定义视图内的静态布局中, 如何做到这一点 TextPaint paint = new TextPaint(Paint.ANTI_ALIAS_FLAG); CharSequence text = "test \\u2022 test"; int textWidth = paint.measureText(text, 0, text.length()); StaticLayout layout = new StaticLayout(text, paint, (in

我想显示一个点字符\u2022 在自定义视图内的静态布局中, 如何做到这一点

TextPaint paint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
CharSequence text = "test \\u2022 test";
int textWidth = paint.measureText(text, 0, text.length());
StaticLayout layout = new StaticLayout(text, paint, (int) textWidth, Layout.Alignment.ALIGN_CENTER, 1f, 0f, true);

你说的集合是什么意思?您的文本变量包含该unicode字符,那么?好的,那么您的意思是test\u2022 test?not test\\u2022 test我想在staticLayout中显示一个点…但它显示ascii,如何显示点字符?其编码为\\u2022