Felipe
Felipe

Reputation: 537

Codename One - Layout issue

I've a GUI built app and I set many Icon images in the code for some components.

The thing is I've made sure all "padding" and "margin" values are the same for the different states of the components (unselected, pressed, etc) but when I try to input data into the TextFields, it seems like the dimensions of some components change without notice and they completely mess with my layout.

Even sometimes some of the icons partially disappear. Please see the following screenshot of before and after text input, where the Container and TextFields shrink

enter image description here

I really don't know what else I can do. I have tried many things, but stil the same outcome. Please help.

Upvotes: 2

Views: 119

Answers (1)

Diamond
Diamond

Reputation: 7483

You need to make the container housing all this components scrollable.

Use Millimeters for your TextField padding and margin, don't use Screen Percentage. From the image in the images you posted, 2mm top and bottom and 1mm left and right would be suitable.

If the components having those icons are pressable like a button, be sure to set their pressedIcon to the same icon.

Lastly, style your TextField Unselected state and copy this to Selected and Pressed states, to avoid erroneous styling.

Upvotes: 1

Related Questions