在代码中通过资源id设置selector类型的颜色值往往不成功,需要用下面这种方式来添加selector资源,然后这只给指定的View
try {
XmlResourceParser xrp = getResources().getXml(R.color.father_btcolor);
ColorStateList cl = ColorStateList.createFromXml(getResources(), xrp);
} catch (Exception ex) {}
if(cl != null){
tl.setTextColor(cl);
}