我需要在 GWT 的 UiBinder 中将许多分离的 CSS 类应用到 1 个元素中,但不知道该怎么做。
在我的 TestView.ui.xml 中,我有
<g:Button text="Log Out" ui:field="logoutButton" addStyleNames="{style.gwt-Button}" addStyleNames="{style.paddedRight}" />
但它产生了运行时错误。
然后我试了一下
<g:Button text="Log Out" ui:field="logoutButton" addStyleNames="{style.gwt-Button style.paddedRight}" />
这次我遇到了编译时错误。
那么,如何在 GWT 的 UiBinder 中将样式名称“多个 css 类”添加到 1 个元素中?
在互联网上找不到信息。
最佳答案
我认为您必须在单独的括号对中的 addStyleNames
属性中指定每个样式名称。
像这样:
<g:Button text="Log Out" ui:field="logoutButton" addStyleNames="{style.gwt-Button} {style.paddedRight}" />
关于css - 如何在 GWT 的 UiBinder 中将样式名称 "Multiple css classes"添加到 1 个元素中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18886448/