TextView 在java中使用Html设置字体大小颜色

else {
            tvGouMaiRenShu.setVisibility(View.VISIBLE);
            tvGouMaiRenShu
                    .setText(Html
                            .fromHtml("剩余<font size='9' color='#58bbed' ><big>&nbsp;&nbsp;&nbsp;"
                                    + goodsNum
                                    + "</big></font>"
                                    + "&nbsp;&nbsp;&nbsp;张"));
        }

效果如下图:

原文地址:https://www.cnblogs.com/zhanganju/p/3948904.html