如何将VaadinHorizo​​ntalLayout中的对齐方式设置为垂直居中?

如何让图标和文本在 Vaadin Horizo​​ntalLayout 内垂直对齐居中?

此代码不起作用:

HorizontalLayout horizontalLayout = new HorizontalLayout(VaadinIcon.EXCLAMATION_CIRCLE_O.create(),new H5("Achtung - Bitte aufmerksam lesen!") );
            horizontalLayout.setAlignItems(FlexComponent.Alignment.CENTER);

回答

你检查文档了吗?https://vaadin.com/components/vaadin-ordered-layout/java-examples有各种例子

horizontalLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER);

还可以查看网络研讨会https://www.youtube.com/watch?v=Efv_cPHEqdQ


以上是如何将VaadinHorizo​​ntalLayout中的对齐方式设置为垂直居中?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>