Android开发中常用到的一些功能

一、修改TextView中部分文字的颜色

tvResetPwd.setText(getResources().getString(R.string.textview_reset_pwd));						
SpannableStringBuilder builder = new SpannableStringBuilder(tvResetPwd.getText().toString());  
ForegroundColorSpan redForegroundColorSpan = new ForegroundColorSpan(Color.RED);						  
builder.setSpan(redForegroundColorSpan, 9, 16, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);						  
tvResetPwd.setText(builder); 


你可能感兴趣的:(android,Android开发,textview)