设置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"

posted @ 2012-11-29 19:28  盗草人  阅读(222)  评论(0编辑  收藏  举报