android中LinearGradient线性渐变

LinearGradient lg=new LinearGradien(0,0,100,100,Color.RED,Color.BLUE,Shader.TileMode.MIRROR);

两种颜色渐变。

LinearGradient shader = new LinearGradient(0, 0, endX, endY, new int[]{startColor, midleColor, endColor},new float[]{0 , 0.5f, 1.0f}, TileMode.MIRROR);


多种颜色渐变

你可能感兴趣的:(android中LinearGradient线性渐变)