我想使现有的布局响应。 我尝试了以下代码,但是即使有足够的空间,它也会使lInputs换行,并且下一行中显示的元素与下一个元素(描述)重叠。我正在使用jarektoro的响应式布局插件
ResponsiveLayout lInputs = new ResponsiveLayout();
ResponsiveRow row = new ResponsiveRow();
ResponsiveColumn column1 = row.addColumn()
.withComponent(tKpiName)
.withComponent(lFrequency)
.withComponent(kpiCommunications);
column1.addRule(DisplaySize.XS,12);
column1.addRule(DisplaySize.MD,6);
lInputs.addRow(row);
lInputs.addComponents(tKpiName, lFrequency, kpiCommunications);
lSaveKPI.addComponents(lInputs);
lSaveKPI.setComponentAlignment(lInputs, Alignment.MIDDLE_RIGHT);
GridLayout lSaveLoad = new GridLayout(1,2);
lSaveLoad.addComponents(lSaveKPI, tKpiDescription);
lSaveLoad.setSpacing(false);
我还在vaadin 8中尝试了以下代码,但是lInputs元素显示出类似“ makeResponsive”的内容。
HorizontalLayout lInputs = new HorizontalLayout();
Responsive.makeResponsive(lInputs);