CodenameOne Google 地图显示在表格的一半

CodenameOne Google Map showing half way on the form

Google 地图显示表格的一半。没有填写完整space。在模拟器上可以,但在设备上不行。

我尝试过使用 BoxLayout Y 布局和 Border Layout,但没有成功

private Container generateInstructionMap() throws IOException {

         Container root =  new Container(new BorderLayout());
         //BorderLayout.center(collected)..encloseY(info, collected); 
         root.add(BorderLayout.CENTER, cnt);
         root.add(BorderLayout.SOUTH, btnAddMarker);


    return root;
}

 public Container generateDashboard(final Form parent) {

        Container dash = new Container(new BoxLayout(BoxLayout.Y_AXIS));

                    Form wizard = new Form();
                    wizard.setLayout(BoxLayout.y());
                    wizard.setTitle("Order Delivery");
                    final Command back = new Command(null) {

                        public void actionPerformed(ActionEvent evt) {

                            //parent.showBack();
                        }
                    };
                    wizard.setBackCommand(back);
                    Tabs wizardtabs = new Tabs();
                   // wizardtabs.setLayout(BoxLayout.y());

                    wizardtabs.addTab("Info", 
                     generateDeliveryStepsWizard(parent));

 wizardtabs.addTab("Info", generateInstructionMap(parent));
   dash.setUIID("Form");
        return dash;

}

显示效果请看图片

您将窗体设置为框布局 Y,这为组件提供了它们的首选高度。由于地图没有 "real" 首选高度,您可以得到它。

如果表单有边框布局,并且您将带有地图的容器放置在中心,那么它会占用完整的 space 表单。此外,默认情况下表单是可滚动的,边框布局禁用滚动,因此行为会更接近您需要的行为,因为地图是平移而不是滚动的。