ColorUtils.setAlphaComponent(color, alpha);
ContextCompat.getColor(Contextcontext,@ColorResintid);
ContextCompat.getDrawable(Contextcontext,@ColorResintid);等
替换已过时getResourse.getColor() api
##代码设置selector color
ColorStateList colorStateList = getResources().getColorStateList(R.color.black);
textView.setTextColor(colorStateList);
网友评论