2

如何最大化 GWT 中的根面板大小?

4

3 回答 3

2

对于全窗口应用程序,请在 EntryPoint中使用RootPanel.get()RootLayoutPanel.get()onModuleLoad()获取容器。两者都将作为绝对定位的小部件附加到文档正文。

从邮件示例:

public void onModuleLoad()
{
    DockLayoutPanel outer = binder.createAndBindUi(this);

    // Get rid of scrollbars, and clear out the window's built-in margin,
    // because we want to take advantage of the entire client area.
    Window.enableScrolling(false);
    Window.setMargin("0px");

    RootLayoutPanel root = RootLayoutPanel.get();
    root.add(outer);
}
于 2011-03-23T06:53:15.030 回答
1

在您的 Project.html 文件中创建一个具有所需尺寸的 div。比在使用 RootPanel 的 onModuoleLoad() 方法中使用 RootPanel.get('divID') 即(在 html 文件中创建的 div)。因此,您可以拥有指定大小的根面板。

于 2011-03-14T09:05:35.820 回答
1

没问题; 根面板是一个绝对面板,覆盖整个浏览器空间

于 2011-03-22T20:52:39.747 回答