相关疑难解决方法(0)

在TextView中更改一个单词的文本颜色

我正在寻找一种方法来改变在一个字的文本的颜色TextView从内Activity.

例如,有了这个:

String first = "This word is ";
String next = "red"
TextView t = (TextView) findViewById(R.id.textbox);
t.setText(first + next);
Run Code Online (Sandbox Code Playgroud)

如何将next文本颜色更改为红色?

string android colors textview

88
推荐指数
4
解决办法
8万
查看次数

标签 统计

android ×1

colors ×1

string ×1

textview ×1