【发布时间】:2013-10-21 16:52:40
【问题描述】:
我知道我可以通过以下方式更改按钮上文本的颜色:
button.setTextColor(getApplication().getResources().getColor(R.color.red)); //TAKE DEFAULT COLOR
或
button.setTextColor(0xff0000); //SET CUSTOM COLOR
或
button.setTextColor(Color.parseColor("#ff0000"));
但是我想为文本使用两种颜色:例如,假设我的按钮具有以下文本:“单击此处”,我希望“单击”部分显示为红色,而“此处”部分显示为蓝色.
这可能吗?
【问题讨论】:
标签: android colors android-view android-button