Layout 代码名一层布局不填充屏幕
我用这个线程实现了浮动按钮: 但我有一个布局问题。内容不想填满屏幕。以下是截图: 下面是我如何创建内容的:Layout 代码名一层布局不填充屏幕,layout,codenameone,layer,Layout,Codenameone,Layer,我用这个线程实现了浮动按钮: 但我有一个布局问题。内容不想填满屏幕。以下是截图: 下面是我如何创建内容的: final Container paneContainer = new Container(new LayeredLayout()); private Container getBottomContainer(Form parent) { newsfeedContainer.setLayout(new BoxLayout(BoxLayout.Y_AXIS
final Container paneContainer = new Container(new LayeredLayout());
private Container getBottomContainer(Form parent) {
newsfeedContainer.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
newsfeedContainer.setScrollableY(true);
loadData();
newsfeedContainer.addPullToRefresh(new Runnable() {
public void run() {
loadData();
}
});
//newsfeedContainer.add(new Button("Button")).add(new Button("Button")).add(new Button("Button")).add(new Button("Button")).add(new Button("Button"));
return newsfeedContainer;
}
private Container getUpperContainer(Form par) {
FlowLayout flow = new FlowLayout(Component.RIGHT);
flow.setValign(Component.BOTTOM);
Container conUpper = new Container(flow);
Button plus = new Button();
FontImage.setMaterialIcon(plus, FontImage.MATERIAL_ADD, 5);
plus.addActionListener((ActionEvent evt) -> {
Form f = new PostComment().commentForm(parent);
f.getToolbar().setBackCommand(parent.getTitle(), BACK_POLICY, e -> parent.showBack());
f.show();
});
conUpper.addComponent(plus);
conUpper.setScrollableX(false);
conUpper.setScrollableY(false);
return conUpper;
}
public Container getContainer(Form parent) {
this.parent = parent;
paneContainer.setScrollableY(false);
paneContainer.addComponent(BorderLayout.center(getBottomContainer(parent)));
paneContainer.addComponent(BorderLayout.south(getUpperContainer(parent)));
return paneContainer;
}
如何使容器填满屏幕,并正确设置右下角的“加号”按钮?制作表单边框布局并将paneContainer放置在中间啊,你救了我一天。谢谢。仅供参考@ShaiAlmog不知道C1是否有ootb浮动按钮。感谢您的实施,我们将尝试实施它。这是我们刚刚宣布的新功能