使用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("我知道了");

 

相关文章:

  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案