我正在寻找一种在 VerticalLayout 中创建页脚的方法。 有一些方法可以使用 VerticalLayout 创建页脚?
有什么想法吗?
最佳答案
一个简单的解决方案。 André Schild 已经提供了宝贵的意见。
VerticalLayout vlMain = new VerticalLayout();
vlMain.setSizeFull();
HorizontalLayout hlFooter = new HorizontalLayout();
hlFooter.setHeight("50px"); // if you want you can define a height.
hlFooter.addComponent(new Label("Test1")); // adding a simple component. You might want to set alignment for that component
vlMain.addComponent(mainComponent);
vlMain.setExpandRatio(mainComponent, 1.0f); // "give" the main component the maximum available space
vlMain.addComponent(hlFooter);
关于java - 带页脚的垂直布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21316247/