<string name="getmoney"><font color="#b8b9b9">钱已存到</font><font color="#3396fc">绑定的支付宝账号</font></string>
这是第一种方法,直接在布局文件中使用就可以了,比较简单!
<string name="getallbagcount"><Data><![CDATA[<font color="#b8b9b9">%1$s</font><font color="#de5d47">%2$d</font><font color="#b8b9b9">个红包</font>]]></Data></string>
tv_total.setText(Html.fromHtml(String.format(mActivity.getResources().getString(R.string.getallbagcount),"收到",res.getData().getTotal())));
这里是第二种写法,需要具体配置不同颜色的不同入参,这样会比较灵活,在代码中使用