改变textView的个别字体颜色

 Spannable span = new SpannableString(getString(R.string.register_need_to_ageree));//例如:register_need_to_ageree是 注册即默认同意用户协议
        span.setSpan(new SpannedString(getString(R.string.register_need_to_ageree)), 7, 11, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.theme_color_default)), 7, 11, Spannable
                .SPAN_EXCLUSIVE_EXCLUSIVE);
        tvUserAgreement.setText(span);

  

posted @ 2016-08-09 15:49  世杰这么大  阅读(266)  评论(0编辑  收藏  举报