代码之家  ›  专栏  ›  技术社区  ›  sharvey

具有100%高度的s:Scroller视口的内容

  •  0
  • sharvey  · 技术社区  · 14 年前

    有没有一种方法可以让滚动条内的组件的内容达到100%的高度。

    下面是一个简单的例子:

    <s:Scroller width="100%" height="100%">
     <s:viewport>
      <s:Group height="100%">
       <s:Rect width="10" height="500">
        <s:fill>
         <s:SolidColor color="0xFF0000"/>
        </s:fill>
        </s:Rect>
       <s:Rect width="10" x="10" height="100%">
        <s:fill>
         <s:SolidColor color="0x00FF00"/>
        </s:fill>
       </s:Rect>
       <s:Rect width="10" x="20" height="100">
        <s:fill>
         <s:SolidColor color="0x0000FF"/>
        </s:fill>
       </s:Rect>
      </s:Group>
     </s:viewport>
    </s:Scroller>
    

    如果运行此代码并向下滚动一点,将得到以下结果:

    scroller example

    有办法解决吗?

    1 回复  |  直到 14 年前
        1
  •  0
  •   sharvey    14 年前