设置TextView样式Android Spannable

Spannable span = (Spannable) textView.getText();
TextAppearanceSpan textappearancespan = new TextAppearanceSpan(
                mcontext, R.style.SynonyText);
span.setSpan(textappearancespan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

SynonyText为Styles.xml设置的属性(颜色,字体,大小等等);
注意: TextView的BufferType, android:bufferType="editable"

原文地址:https://www.cnblogs.com/daocaowu/p/2795171.html