题
我有一个GWT-Ext窗口(用作弹出窗口),此弹出窗口是从GWT应用程序启动的。我正在寻找一种解决方案,以将弹出窗口的窗口尺寸设置为一个尺寸,它几乎填充了屏幕,而不是最大化,但要填充GWT应用程序启动此弹出窗口的GWT应用程序的下层区域。有人知道解决该问题的解决方案吗?
解决方案
尝试这样的事情:
int windowHeight=Window.getClientHeight()-10; //I subtract 10 from the client height so the window isn't maximized.
int windowWidth=Window.getClientWidth()-10; //I subtract 10 from the client width so the window isn't maximized.
yourExtGwtWindow.setHeight(windowHeight);
yourExtGwtWindow.setWidth(windowWidth);
其他提示
这将大小到屏幕尺寸(不是当前浏览器大小)
yourExtGwtWindow.setHeight(screenHeight());
yourExtGwtWindow.setWidth(screenWidth());
...
public static native int screenWidth()
/*-{
return screen.availWidth;
}-*/;
public static native int screenHeight()
/*-{
return screen.availHeight;
}-*/;
不隶属于 StackOverflow