使用Spannablestring和ForegroundColorSpan。

SpannableString string2 = new SpannableString("自助导入会员和连续开单\n3个月可获得免费短信服务");
        ForegroundColorSpan span2 = new ForegroundColorSpan(getResources().getColor(R.color.worker_main_worker));
        string2.setSpan(span2, 12, 15, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);  //12-15个字符颜色为span2中设置的值
        contentTv2.setText(string2);
        ikonwBtn.setText("我知道了");

 

posted on 2015-10-26 16:18  Ivan Aldrich  阅读(1171)  评论(0编辑  收藏  举报