【发布时间】:2023-06-16 02:53:01
【问题描述】:
对于 UI 标记,我使用 UIBinder。在特定区域,我想放置标志,然后动态改变它:
<ui:UiBinder
xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui' >
<ui:with
field='res'
type='com.myproject.client.resources.Resources' />
<g:Image resource='{res.offline}'/>
客户端包:
public interface Resources extends ClientBundle {
@Source("offline.png")
public ImageResource offline();
@Source("online.png")
public ImageResource online();
// ... and so on
}
当用户开始会话时,他的徽标会发生变化。
如何更改在 UI 标记中声明的图像?
【问题讨论】: