<分区>
最佳答案
TextView text = (TextView)findViewById(R.id.text);
String simple = "Enter your name ";
String colored = "*";
SpannableStringBuilder builder = new SpannableStringBuilder(simple+colored);
builder.setSpan(new ForegroundColorSpan(Color.RED), simple.lenth(), builder.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
text.setText(builder);
关于java - 如何在android中的textview顶部使用红色*符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41716917/