我需要在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中将1个元素addStyleNames“Multiple css classes”?
在互联网上找不到信息.
解决方法
我认为您必须在单独的括号对中的addStyleNames属性中指定每个样式名称.
像这样的东西:
<g:Button text="Log Out" ui:field="logoutButton" addStyleNames="{style.gwt-Button} {style.paddedRight}" />