【发布时间】:2010-07-27 15:28:26
【问题描述】:
有没有办法让滚动条内的组件内容达到 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>
如果你运行这段代码并向下滚动一点,你会得到:
如您所见,绿色条(设置为 100% 高度)仅使用视口的高度,而不是其父组的高度,红色条将其拉伸为 500px 高。
有没有办法解决这个问题?
【问题讨论】:
-
使用 top="0" bottom="0" 产生相同的结果。
标签: apache-flex height viewport flex4 scroller