Button 按钮字体颜色实现
btn.setTextColor(mContext.getResources()
.getColor(R.color.selector_sku_btn_tv));
这个是定义在String里的
如果是xml里的话要
XmlPullParser xrp = mContext.getResources()
.getXml(R.color.selector_sku_btn_tv);
ColorStateList csl;
try {
csl = ColorStateList.createFromXml(mContext.getResources(),
xrp);
btn.setTextColor(csl);
} catch (XmlPullParserException e) {
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。