Tabs and component height

50 views
Skip to first unread message

Tim Gaul

unread,
Aug 5, 2014, 9:39:51 AM8/5/14
to codenameone...@googlegroups.com
I have a simple problem, which I can't seem to get right, much to my frustration.

This simple piece of code:

        Form mainForm = new Form("Main");
        mainForm
.setScrollable(false);

       
Tabs tabs = new Tabs();
        tabs
.setUIID("Tabs");

       
Container homeContainer = new Container();
        homeContainer
.setLayout(new BorderLayout());      

       
MapComponent mc = new MapComponent(new GoogleMapsProvider(Services.API_KEY));

       
Button button = new Button("Click Me!");

        homeContainer
.addComponent(BorderLayout.CENTER, mc);
        homeContainer
.addComponent(BorderLayout.SOUTH, button);

        tabs
.addTab("Home", homeContainer);

        mainForm
.addComponent(tabs);
        mainForm
.show();


is resulting in the mapcomponent being to tall and pushing the button off the screen. How do I ensure the mapcomponent resizes correctly to allow the button to remain visible?

Thanks!

Tim

Chen Fishbein

unread,
Aug 5, 2014, 10:06:23 AM8/5/14
to codenameone...@googlegroups.com
sets the Form layout to borderlayout and place tabs in the center

Tim Gaul

unread,
Aug 11, 2014, 4:41:56 AM8/11/14
to codenameone...@googlegroups.com
Thanks Chen,

Such a simple solution and it never occurred to me!
Reply all
Reply to author
Forward
0 new messages