DockLayoutPanel 无法正常工作
下一个方式描述我的面板
<!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'>
<g:DockLayoutPanel unit="PX" width="600" >
<g:north size="85">
....
</g:north>
<g:center>
....
</g:center>
</g:DockLayoutPanel>
我以 GWT 为北和中下一个 div 生成的
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 85px;"
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
。它们包含我需要的数据,但第二个 div 不显示。我哪里错了?
UPD: 仅举个例子,因为
<g:center>
<g:FlowPanel height="100%">
<g:Label height="100%">TEST2</g:Label>
</g:FlowPanel>
</g:center>
我得到
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
<div style="height: 100%; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div class="gwt-Label" style="height: 100%;">TEST2</div>
</div>
</div>
</div>
I describe my panel in next way
<!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'>
<g:DockLayoutPanel unit="PX" width="600" >
<g:north size="85">
....
</g:north>
<g:center>
....
</g:center>
</g:DockLayoutPanel>
GWT generated for north and center next divs.
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 85px;"
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
They contains data that what I need, but second div doesn't displayed. Where I am wrong?
UPD:
Just for example, for
<g:center>
<g:FlowPanel height="100%">
<g:Label height="100%">TEST2</g:Label>
</g:FlowPanel>
</g:center>
I get
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
<div style="height: 100%; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div class="gwt-Label" style="height: 100%;">TEST2</div>
</div>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想我知道你做错了什么。
你需要这个:
而不是:
因为如果你使用 uibinder,你需要 RootLayouPanel!
我希望它能帮助你!
I think I know what you did wrong.
You need this:
instead of:
Because if you use uibinder you need the RootLayouPanel!
I hope it will help you!
我已经解决了这个问题:
I have fixed this next way:
编辑:
重要的是,
center
小部件中有什么。示例 FlowPanel 将填充该区域,但 VerticalPanel 不会。然后您必须将height
属性设置为 100%。Edit:
The important thing is, what is in the
center
widget. Example FlowPanel will fill out the area, but VerticalPanel not. Then you have to set theheight
property 100%.