Google好东西

2017-04-19  本文已影响29人  谁帮我起个名字

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);

上一篇 下一篇

猜你喜欢

热点阅读