TextField background transparency in Codenameone when graphics background

My problem is that i have a Form with a 2 colour background; On top i have a bg transparent textfield. When it renders in the simulator it looks fine as the TextField is positioned across the point in the background where the colours meet (as per field 2).

But when i click into field 3, the Textfield takes on a solid background column of just one of my background colours, when i expect it to stay transparent.  (

The background consists of a LayeredLayout which is darker blue colour, and then i have a light blue graphic in the bottom half:

class RectangleComponent extends Component {

private int bottomColour;

protected void setBottomColour(int colour) {
    bottomColour = colour;
}

@Override
protected Dimension calcPreferredSize() {
    return new Dimension(250, 250);
}

@Override
public void paint(Graphics g) {
    g.setColor(bottomColour);
    int[] int_x = new int[] { 0, getWidth(), getWidth(), 0 };
    int[] int_y = new int[] { (int) (getHeight() / 2.5), ((int) (getHeight() / 2.5)) + 150, getHeight(),
            getHeight() };

    g.fillPolygon(int_x, int_y, 4);
}

My TextField is:

public class TextCustom extends TextField {

public TextCustom(String hint, String controlName, int maxChars) {
    Border border = Border.createCompoundBorder(null, Border.createLineBorder(1, 0xffffff), null, null);
    setName(controlName);
    setUIID("v2_Label11LightPadMarg");
    getAllStyles().setBorder(border);
    setHint(hint);
    getHintLabel().setUIID("v2_Label11LightPadMarg");
    getHintLabel().getAllStyles().setFgColor(0xffffff);
    getHintLabel().getAllStyles().setBgTransparency(0);
    getHintLabel().setAlignment(Component.TOP);
    getAllStyles().setBgTransparency(0);
    getAllStyles().setFgColor(0xffffff);
    getSelectedStyle().setBgTransparency(0);

    setCursorPosition(0);
    setMaxSize(maxChars);
    setColumns(maxChars);
    getAllStyles().setMarginLeft(20);
    getAllStyles().setMarginRight(20);
}

}

Thanks

1 answer

  • answered 2018-08-14 21:53 Think.Smart

    Looks like this is a problem on the simulator. On the android device it seems fine. Closing.