How to set multiple spans on a TextView's formatted text with placeholder, using customized span?
问题 Background I know how to set multiple spans on a partial text within a static text, as I've asked here : final SpannableString text = new SpannableString("Hello stackOverflow"); text.setSpan(new RelativeSizeSpan(1.5f), text.length() - "stackOverflow".length(), text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); text.setSpan(new ForegroundColorSpan(Color.RED), 3, text.length() - 3, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); tv.setText(text); This will set the "stackOverflow" to have 2 spans on