SpannableString styledText = new SpannableString(getTimeLabel(timeType)
+ "事故" + count + "起,按类型统计");
styledText.setSpan(new TextAppearanceSpan(mContext,
R.style.countTextViewNormal), 0, getTimeLabel(timeType)
.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
styledText.setSpan(new TextAppearanceSpan(mContext,
R.style.countTextViewZero),
getTimeLabel(timeType).length() + 2, String.valueOf(count)
.length() + getTimeLabel(timeType).length() + 2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTitle.setText(styledText, TextView.BufferType.SPANNABLE);
效果图: