4
ShapeDrawable.ShaderFactory sf = new ShapeDrawable.ShaderFactory() {
@Override
public Shader resize(int width, int height) {
LinearGradient lg = new LinearGradient(0, 0, 0, border.getHeight(),
new int[] {
Color.CYAN,
Color.WHITE,
Color.WHITE
}, //substitute the correct colors for these
new float[] {
0, 0.45f, 0.55f, 1 },
Shader.TileMode.REPEAT);
return lg;
}
}
中的LinearGradient颜色在这个代码,而不是使用Color.CYAN
我想插入该颜色的十六进制值。有什么建议么?如何使用十六进制值来指定的Android
它说构造函数(int,int,int)没有定义。我如何定义它? – Khush 2011-05-31 05:57:22
更好,只有1 int? – oliholz 2011-05-31 05:58:36
我不知道。需要它的渐变效果..我如何定义1 int ?? – Khush 2011-05-31 05:59:58