Change image of component "Check"

14 views
Skip to first unread message

rdvg...@gmail.com

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

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.
Muestra.png

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

unread,
Jul 4, 2021, 10:04:22 PM7/4/21
to CodenameOne Discussions
Hi,
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: https://www.codenameone.com/developer-guide.html#theme-constants-section
Specifically: checkBoxCheckDisImage, checkBoxCheckedImage, checkBoxUncheckDisImage and checkBoxUncheckedImage.

rdvg...@gmail.com

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