使用 UiBinder 在 GWT CustomButton 的不同面上设置样式
我试图在 ToggleButton 的不同面上设置样式名称(即 upFace、downFace,...)。看起来在脸上设置 styleName 不起作用。例如,以下内容不起作用:
<g:ToggleButton>
<g:upFace styleName='{style.myToggleButton-up}' />
</g:ToggleButton>
但我注意到在 ToggleButton 本身上设置样式名称时......
<g:ToggleButton styleName='{style.myToggleButton}' />
生成的 HTML 看起来像这样:
<div class="GPAKHSCBGG GPAKHSCBGG-up" role="button" aria-pressed="false">...</div>
但是,即使我定义了 {style.myToggleButton-up},它没有填充到 GPAKHSCBGG-up。所以我想知道如何才能做到这一点而不必模拟全局 .gwt-ToggleButton-up 样式表。请帮忙。
I'm trying to set style names on different faces of ToggleButton (i.e. upFace, downFace, ...). It looks like setting styleName on a face doesn't work. For example the following won't work:
<g:ToggleButton>
<g:upFace styleName='{style.myToggleButton-up}' />
</g:ToggleButton>
But I noticed when setting the style name on ToggleButton itself...
<g:ToggleButton styleName='{style.myToggleButton}' />
... the generated HTML will look something like this:
<div class="GPAKHSCBGG GPAKHSCBGG-up" role="button" aria-pressed="false">...</div>
However, even if I have {style.myToggleButton-up} defined, it is not populated to GPAKHSCBGG-up. So I'm wondering how can I do this without having to mock the global .gwt-ToggleButton-up stylesheet. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://examples.roughian.com/index.htm#Widgets~ToggleButton
所有 GWT 组件都有预定义的 CSS 类定义,您尝试的内容并没有覆盖这些定义。
http://examples.roughian.com/index.htm#Widgets~ToggleButton
All GWT components have predefined CSS Class definitions, what you tried didn't override the definitions.
解决方案:
Solution: