Android设置字体颜色

1、按钮设置字体颜色

int color;
if(button.isEnabled()) {
    color = getResources().getColor(R.color.colorEnableTextBackgroundColor);
}else {
    color = getResources().getColor(R.color.colorUnableTextBackgroundColor);
}
button.setTextColor(color);
注意:不要直接,会设置失败
button.setTextColor(R.color.colorUnableTextBackgroundColor);

2、设置spinner字体颜色:(待补充)

猜你喜欢

转载自blog.csdn.net/hqyhqyhq/article/details/79216465