Putting button at the bottom of container

23 views
Skip to first unread message

Peter Bell

unread,
Nov 20, 2019, 7:17:52 PM11/20/19
to CodenameOne Discussions
I like to put a button at the bottom of a container with null room between the bottom of the container and the butoon.

The container has a background image.
The margins of the button are put to zero.
The padding of the container is set to zero
The container has a borderlayout
And the button is put South.

But still i can see a part of the Backgroundimage.

How can i get rid of this spare room

Shai Almog

unread,
Nov 20, 2019, 9:56:54 PM11/20/19
to CodenameOne Discussions
Put the button in the center if you want it to occupy all available space in the container.

Peter Bell

unread,
Nov 21, 2019, 1:43:26 AM11/21/19
to CodenameOne Discussions
I want to have the button at the bottom just like the tittle = statusbar.  I dont want to see a stroke of the backgrond image of the container. 
It looks like i cant set the margin of the button really zero.

Op donderdag 21 november 2019 03:56:54 UTC+1 schreef Shai Almog:

Peter Bell

unread,
Nov 21, 2019, 6:52:09 AM11/21/19
to CodenameOne Discussions

I found the answer the padding and margin of the form eand container must be set to zero.  But on the device and simulator i still got left  and right of the button a little piece of  the backgrondimage 

Op donderdag 21 november 2019 07:43:26 UTC+1 schreef Peter Bell:

Shai Almog

unread,
Nov 21, 2019, 10:07:22 PM11/21/19
to CodenameOne Discussions
Use the component inspector to see which elements take up the space. Placing something in the south gives it the preferred size so that might not match your expectations of filling up the parent.
Reply all
Reply to author
Forward
0 new messages