css - 如何在 GWT 的 UiBinder 中将样式名称 "Multiple css classes"添加到 1 个元素中?

标签 css gwt uibinder gwtp

我需要在 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/

相关文章:

php - 在 php 中使用背景图像

gwt - 创建可重用的布局样式 uibinder

java - Maven "could not parse error message"(Java 7 + Maven 2)

java - 获取小部件实例

java - 在单个 GWT Presenter 中显示两个 UI.XML 的内容

javascript - 自动递增左侧的编号列

css - Codeigniter 本地主机 CSS

javascript - GWT HTML-Class 标签样式未混淆

java - 如何在GWT中为BlurEvent正确添加UiHandler?

html - Bootstrap 列中的图像右侧有空格