定义好的颜色值为private int indicatorColor = 0xff9900;
我在调用setColor方法时,传入indicatorColor ,透明的,??????
看了下源码,是这样定义的
/**
* Set the paint's color. Note that the color is an int containing alpha
* as well as r,g,b. This 32bit value is not premultiplied, meaning that
* its alpha can be any value, regardless of the values of r,g,b.
* See the Color class for more details.
*
* @param color The new color (including alpha) to set in the paint.
*/
public native void setColor(int color);设置的颜色值要包括透明度的 ,否则就视为透明的。
本文解释了在设置颜色值时如何正确包含透明度分量。通过了解颜色值的32位构成,包括红色、绿色、蓝色及透明度,开发者可以避免在调用setColor方法时出现错误,确保颜色能够正确显示。
1680

被折叠的 条评论
为什么被折叠?



