GWT相对宽度 [英] GWT Relative Width
问题描述
我正在尝试制作具有相对大小参数的滚动面板。但是如果你有int值,比如 Window.getHeight ,那么
ScrollPanel.setSize(String,String)
code>。
当我尝试 ScrollPanel.setSize(100%,150px);
它不会更改滚动面板的高度,而是使用默认值。任何帮助,将不胜感激。根据GWT doc [ScrollPanel] [1],他们似乎是非常严格的关于在绝对中使用宽度,而不是在相对 CSS中使用宽度。
因此,问题可能出在100%参数上。
[1]: http:// google-web- toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/ScrollPanel.html#setSize(java.lang.String ,java.lang.String)
I'm trying to make a scroll panel that has relative size parameters. But the ScrollPanel.setSize(String, String)
function is impossible to work with if you have int values such as those returned by Window.getHeight
.
When I try ScrollPanel.setSize("100%", "150px");
it doesn't change the height of the scroll panel and instead uses the default. Any help would be appreciated.
According to the GWT doc for [ScrollPanel][1], they seem to be pretty strict about using the width in absolute and not relative CSS units. Thus the problem may be with the "100%" parameter.
[1]: http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/ScrollPanel.html#setSize(java.lang.String, java.lang.String)
这篇关于GWT相对宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!