作者:极神bd韵 | 来源:互联网 | 2023-07-01 15:44
***将0.01变为红色*privatevoidsetRedText(TextViewtv_tips){SpannableStringBuilderbuilderne
/**
* 将0.01变为红色
*/
private void setRedText(TextView tv_tips) {
SpannableStringBuilder builder = new SpannableStringBuilder("请在您账户中充值0.01元,进行身份验证");
ForegroundColorSpan span = new ForegroundColorSpan(Color.RED);
builder.setSpan(span, 8, 12, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tv_tips.setText(builder);
}