标签:style color ar os 使用 sp for strong on
正确的方法:
使用AbsoluteSizeSpan时要每次都new一个新对象出来,如果定义好一个,连续使用,则只有最后一个生效。 前面使用的都回失去效果。
如下使用:
SpannableString spanString = new SpannableString(sb.toString());
spanString.setSpan(new AbsoluteSizeSpan(90), firstMarkStart, firstMarkEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spanString.setSpan(new ForegroundColorSpan(R.color.orange_color), firstMarkStart, firstMarkEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spanString.setSpan(new AbsoluteSizeSpan(90), secondMarkStart, secondMarkEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spanString.setSpan(new ForegroundColorSpan(R.color.orange_color), secondMarkStart, secondMarkEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
this.timerLabel.setText(spanString);
标签:style color ar os 使用 sp for strong on
原文地址:http://www.cnblogs.com/feitianlee/p/4092267.html