2010年12月7日 星期二

Google Web Toolkit–FlowPanel使用限制

<!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'> 
    <ui:style> 
        .panel { 
            background-color: ivory; 
        } 
    </ui:style>

    <g:DockLayoutPanel unit="EM" width="225px"> 
        <g:lineStart size="7.5"> 
            <g:ScrollPanel> 
                <g:FlowPanel width="100%" height="100%" ui:field="mainMenu"/> 
            </g:ScrollPanel> 
        </g:lineStart> 
    </g:DockLayoutPanel>    

</ui:UiBinder> 

使用 FlowPanel 時需注意 ScrollPanel 不能包在 AbsolutePanel 與 FlowPanel 裡面,會造成 Scrollbar 無法正常作用,只能包在 DockLayoutPanel 裡,才會正常作用

確定可正常作用的 Panel 為

  • DockLayoutPanel
  • HorizontalSplitPanel

不正常的為

  • AbsolutePanel
  • FlowPanel

沒有留言:

張貼留言