我正在尝试使用DockLayoutPanel来布局我的页面,我正在使用gwt-platfrom插件来创建展示者和视图对。当我在view.ui.xml中添加了以下代码时,我只能看到标题部分,其余部分不可见,我的方法出了什么问题?
    <ui:style>        
    .eastPanel {
        background-color: #F60;
    }
    .westPanel {
        background-color: #EEE;
    }
    .northPanel {
        background-color: #39F;
    }
    .southPanel {
        background-color: #99C;
    }
    .centerPanel {
        background-color: #FFC;
    }       
</ui:style>
 <g:DockLayoutPanel unit='EM'>
   <g:north size='5'>
     <g:FlowPanel styleName="{style.northPanel}">
       <g:Label>This is the NORTH panel</g:Label>
     </g:FlowPanel>
   </g:north>
   <g:west size='15'>
     <g:FlowPanel styleName="{style.westPanel}">
       <g:Label>This is the WEST panel</g:Label>
     </g:FlowPanel>
   </g:west>
   <g:center>
     <g:FlowPanel styleName="{style.centerPanel}">
       <g:Label>This is the CENTER panel</g:Label>
     </g:FlowPanel>
   </g:center>
 </g:DockLayoutPanel>
谢谢,
发布于 2012-11-24 18:38:08
我找到了不显示页面的原因在写作时有两个错误,1.只使用一个单位(UM/PX/Percent)来构造DockLayoutPanel的所有侧面2.因为我使用的是gwt平台,所以我需要在我的演示者的revealInParent()中使用RevealRootLayoutContentEvent.fire(this,this);而不是RevealRootContentEvent.fire(this,this);
发布于 2012-11-20 06:52:36
如果你没有在任何地方更改em,那么它的默认大小是16px。因此,192 em可以轻松地表示3,072像素。我不知道当一个区域比屏幕大的时候,DockLayoutPanel是如何运行的,但我很确定它看起来并不漂亮。
另一种可能是,如果不是从父小部件获取高度,则需要设置高度为DockLayoutPanel。
发布于 2012-11-21 20:58:41
我以前遇到过这个问题。只需设置中心面板的高度即可。一切都会好起来的。
https://stackoverflow.com/questions/13459755
复制相似问题