Change image of component "Check"

Skip to first unread message

Jul 4, 2021, 2:03:29 AM7/4/21
to CodenameOne Discussions

I know how to place a new image in the CN1 Designer, but in the case of components like Check I need to change the background color only of the check and from what I understand this is achieved by changing the image.
I tried to modify the UIID and the results were not good.

1. How big should the new image be (I imagine it should be png)?
2. Can you download the current image that is in the theme to be able to manipulate it in an editor?

Shai Almog

Jul 4, 2021, 10:04:22 PM7/4/21
to CodenameOne Discussions
the current check box isn't in the theme. It's a material icon that's a special case.
If you replace it you need to use a MultiImage so the size will be different based on the device density so there's no accurate size in pixels.

Look for the code setRadioButtonImages.

Alternatively you can use a few theme constants:
Specifically: checkBoxCheckDisImage, checkBoxCheckedImage, checkBoxUncheckDisImage and checkBoxUncheckedImage.

Jul 5, 2021, 1:09:29 AM7/5/21
to CodenameOne Discussions
Reply all
Reply to author
0 new messages