GWT DockLayoutPanel 隐式调整非中心项目的大小?
我的布局定义如下:
<g:DockLayoutPanel unit="PX">
<g:north size="100">
<g:Label>top</g:Label>
</g:north>
<g:center>
<g:ScrollPanel>
<g:VerticalPanel>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
</g:VerticalPanel>
</g:ScrollPanel>
</g:center>
<g:south size="100">
<g:Label>bottom</g:Label>
</g:south>
</g:DockLayoutPanel>
想法是将整个页面分为 3 部分:固定大小的顶部和底部以及橡胶中心。这绝对没问题,但我不喜欢南北部分的定义方式——它们的高度是硬编码的(都是 100px)。
在不硬编码高度的情况下是否可以获得相同的结果?
I have layout defined like this:
<g:DockLayoutPanel unit="PX">
<g:north size="100">
<g:Label>top</g:Label>
</g:north>
<g:center>
<g:ScrollPanel>
<g:VerticalPanel>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
<g:Label>center</g:Label>
</g:VerticalPanel>
</g:ScrollPanel>
</g:center>
<g:south size="100">
<g:Label>bottom</g:Label>
</g:south>
</g:DockLayoutPanel>
The idea is to get the whole page divided into 3 parts: both fixed-size top and bottom and rubber center. That works absolutely fine but I don't like the way both north and south parts are defined - their heights are hardcoded (both are 100px).
Is it possible to get the same result without hardcoding heights?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,使用
HeaderPanel
相反。Yes, use a
HeaderPanel
instead.