`

SpannableStringBuilder的简单用法

 
阅读更多
一段代码,贴了自己以后看:
TextView mText = (TextView) findViewById(R.id.mText);
		String mTxt = "你说的是人话么,df是么好的";
		SpannableStringBuilder spannable = new SpannableStringBuilder(mTxt);
		ForegroundColorSpan span = new ForegroundColorSpan(Color.RED);
		spannable.setSpan(span, 0, mTxt.length()-4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
		mText.setText(spannable);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics