I am trying to have a gradient effect in a horizontalFieldManager through a function. then I am trying to place some controls on top of it.
here is my code
static public void drawVerticalGradientRoundRect(Graphics g, int x, int y, int w, int h, int arc, int color1,
int color2) {
/*--3------4-
2 5
| |
1 6
| |
| |
12 7
|11--10----9--8
*/
int xPts[] = {x, x, x + arc, x + w - arc, x + w, x + w, x + w, x + w, x + w - arc, x + arc, x, x};
int yPts[] = {y + arc, y, y, y, y, y + arc, y + h - arc, y + h, y + h, y + h, y + h, y + h - arc};
int color[] = {color1, color1, color1, color1, color1, color1, color2, color2, color2, color2, color2, color2};
byte start = Graphics.CURVEDPATH_QUADRATIC_BEZIER_CONTROL_POINT;
byte end = Graphics.CURVEDPATH_END_POINT;
byte endPts[] = {end, start, end, end, start, end, end, start, end, end, start, end};
g.drawShadedFilledPath(xPts, yPts, endPts, color, null);
but by using this code every thing else on that place is not visible.
This is because this gradient function will create a round rectangle which comes on top of all the other contro u have place at that place.
try using
just after the statement from where you are callng this function
Hope it will work..