【问题标题】:How to resize the draggers of the SplitLayoutPanel in GWT UIBinder template如何在 GWT UIBinder 模板中调整 SplitLayoutPanel 的拖动器大小
【发布时间】:2011-07-27 19:46:02
【问题描述】:

我想让SplitLayoutPanel 的拖动器更小。我可以用 CSS 样式来做到这一点吗?我尝试了填充和边框,但都没有效果。

【问题讨论】:

    标签: gwt uibinder


    【解决方案1】:

    您不能在 CSS 中设置拆分器大小,因为拆分器是布局结构的一部分,它在内部跟踪大小(出于同样的原因,您需要在其他布局面板上硬编码大小)。但是你可以通过构造函数SplitLayoutPanel(int splitterSize)设置拆分器大小。

    【讨论】:

    • 好的,有道理。我可以在 UIBinder ui.xml 文件中设置构造函数参数吗?我试过: 但这给出了错误: Class SplitLayoutPanel has no proper setSplitterSize() method Element
    • 是的,但在这种情况下不在 ui.xml 中。在这种情况下,在您的 java 代码集 @UiField(provided=true) SplitLayoutPanel mySplitLayoutPanel = new SplitLayoutPanel(1); 和 ui.xml 中添加到 SplitLayoutPanel ui:field=mySplitLayoutPanel"`。有关更多信息,请参阅:code.google.com/webtoolkit/doc/latest/…(ps。在 stackoverflow 上标记您的答案是一种很好的做法认为回答正确)
    【解决方案2】:

    您可以将大小(以像素为单位)指定为停靠边缘元素的属性。例如,下面设置一个宽度为 150px 的西边。

    <g:SplitLayoutPanel>
       <g:west size="150">
         <!--your west edge elements -->
       </g:west>
       <g:center>
         <!--your center elements -->
       </g:west>
    </g:SplitLayoutPanel>  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-30
      • 1970-01-01
      • 2011-12-10
      • 1970-01-01
      相关资源
      最近更新 更多