【发布时间】:2014-05-06 17:39:49
【问题描述】:
此代码有效,中心面板正确展开:
HorizontalLayout header = new HorizontalLayout(new Label("HEADER"));
HorizontalLayout center = new HorizontalLayout(new Label("CENTER"));
HorizontalLayout footer = new HorizontalLayout(new Label("FOOTER"));
VerticalLayout verticalLayout = new VerticalLayout(header, center, footer);
verticalLayout.setExpandRatio(center, 1.0f);
verticalLayout.setSizeFull();
setContent(verticalLayout);
但是这段代码不起作用,中心面板展开但左右面板不可见:
VerticalLayout left = new VerticalLayout(new Label("LEFT"));
VerticalLayout center = new VerticalLayout(new Label("CENTER"));
VerticalLayout right = new VerticalLayout(new Label("RIGHT"));
HorizontalLayout horizontalLayout = new HorizontalLayout(left, center, right);
horizontalLayout.setExpandRatio(center, 1.0f);
horizontalLayout.setSizeFull();
setContent(horizontalLayout);
知道为什么以及如何使它起作用吗?
感谢您的帮助!
【问题讨论】: