android 一个textview不同样式

String length = bean.getData().getChildren_list().size() + "";
SpannableStringBuilder builder = new SpannableStringBuilder("所有成员" + length + "人");
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(this, R.color.blue)), 4, 4 + length.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new AbsoluteSizeSpan(50), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
memberNumTv.setText(builder);

 

你可能感兴趣的:(安卓)