How can I make an image button with transparent background?
The default background is grey color, I created the button with empty text and setIcon, something like this:
backButton = new Button(); //"Back");
backButton.setIcon(backIcon);
iface.createRoot(AxisLayout.vertical(), ROOT, modeLayer).
setStyles(make(VALIGN.top, HALIGN.right)).
setBounds(0, 0, width, height).
add(backButton);
But could not figure out how to make the button to be transparent from the API / source code.
Any help / hint greatly appreciated.
You want to use
Style.BACKGROUND.If you want all buttons in your entire UI to have a blank background, then configure your root stylesheet like so:
If you just want a particular button to have a blank background, configure it on the button:
Note also that SimpleStyles defines the backgrounds for buttons. If you start with a completely blank stylesheet, you can omit background definitions for your buttons and they will be blank.