我有一个基本的 ui-binder 布局文件,并且想将画布放入主要内容区域。
但是使用以下会产生错误:
No class matching "canvas" in urn:import:com.google.gwt.canvas.client: <c:canvas ui:field='canvas'>
我的消息来源有什么问题?
.ui.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:c='urn:import:com.google.gwt.canvas.client'>
<g:DockLayoutPanel>
<!-- other stuff... ->
<g:center>
<c:canvas ui:field="canvas" />
</g:center>
</g:DockLayoutPanel>
</ui:UiBinder>
.java:
@UiField//(provided = true)
Canvas canvas;
@Override
public void onModuleLoad() {
canvas = Canvas.createIfSupported();
canvas.setWidth("400px");
canvas.setHeight("400px");
canvas.setCoordinateSpaceWidth(400);
canvas.setCoordinateSpaceHeight(400);
}