Android中的渐变

LinearGradient的用法
LinearGradient linearGradient;
linearGradient = new LinearGradient(0, 0, 0, getHeight(), 0xff808080, 0x33808080,CLAMP);
getPaint().setShader(linearGradient);
TextPaint paint = getPaint();
paint.setColor(getCurrentTextColor());
paint.drawableState = getDrawableState();
 
posted @ 2017-10-31 23:38  dub  阅读(232)  评论(0编辑  收藏  举报