final StyleSpan bss = new StyleSpan(android.graphics.Typeface.BOLD);
final SpannableString ss = new SpannableString("How to " + text + " in " + type);
ss.setSpan(bss, 7, text.length() + 7, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
ss.setSpan(bss, 7 + text.length() + 4, ss.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
textView.setText(ss);
我想做text
和type
大胆。但唯一的类型是粗体。
我错过了什么?