我怎样才能改变一个TextView的颜色组成部分? [英] how can I change color part of a TextView?

查看:170
本文介绍了我怎样才能改变一个TextView的颜色组成部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 文本=文本+ CepVizyon.getPhone code()+\ñ\ N
            +的getText(R.string.currentversion)+ CepVizyon.getLicenseText();
    activati​​onText.setText(文本);
myTextView.setText(文本);
 

我想改变颜色CepVizyon.getPhone code()的字符串...我怎么能做到这一点?

解决方案

  myTextView.setText(Html.fromHtml(文字+<字体颜色=白>+ CepVizyon.getPhone code()+< / FONT>< BR>< BR>中
            +的getText(R.string.currentversion)+ CepVizyon.getLicenseText()));
 

text = text + CepVizyon.getPhoneCode() + "\n\n"
            + getText(R.string.currentversion) + CepVizyon.getLicenseText();
    activationText.setText(text);   
myTextView.setText(text);

I want to change color for CepVizyon.getPhoneCode()'s string... how can I do this??

解决方案

myTextView.setText(Html.fromHtml(text + "<font color=white>" + CepVizyon.getPhoneCode() + "</font><br><br>"
            + getText(R.string.currentversion) + CepVizyon.getLicenseText()));

这篇关于我怎样才能改变一个TextView的颜色组成部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆