当父级没有固定高度时,clipAndEnableScrolling?

时间:2010-11-21 12:39:05

标签: flex flex4

我在使用clipAndEnableScrolling时遇到一些问题,当父级具有固定高度时,它适用于VGroup,但如果父级没有固定高度,则它不起作用且内容溢出。 e.g:

      <s:TitleWindow width="500" height="500">

          <s:VGroup width="100%">

            <s:Group width="100%">

              <!-- The content in here changes height based on the state, I won't complicate this example with the details -->

            </s:Group>   

            <s:Group width="100%" clipAndEnableScrolling="true">

                    <s:Scroller height="100%" width="100%">
                        <s:DataGroup dataProvider="{someData}" width="100%">

                            <s:layout>
                                <s:VerticalLayout gap="1"/>
                            </s:layout>

                        </s:DataGroup>

                    </s:Scroller>
            </s:Group>

         </s:VGroup>

       </s:TitleWindow>

这是一个人为的例子,但重点是我不提前提到第一组的高度,所以无法设置第二组的高度,实际上组件也相当多了复杂的上述人为的例子,所以我不想进行任何形式的体操来计算第二组以上所有事物的高度。

有谁能告诉我如何在第二组上获得滚动条?

干杯,

克里斯

2 个答案:

答案 0 :(得分:0)

你可以尝试在所有组中将高度设置为100%,类似这样的

 <s:TitleWindow width="500" height="500">

      <s:VGroup width="100%" height="100%">

        <s:Group width="100%" height="100%">

          <!-- The content in here changes height based on the state, I won't complicate this example with the details -->

        </s:Group>   

        <s:Group width="100%" height="100%" clipAndEnableScrolling="true">

                <s:Scroller height="100%" width="100%">
                    <s:DataGroup dataProvider="{someData}" width="100%" height="100%">

                        <s:layout>
                            <s:VerticalLayout gap="1"/>
                        </s:layout>

                    </s:DataGroup>

                </s:Scroller>
        </s:Group>

     </s:VGroup>

   </s:TitleWindow>

答案 1 :(得分:0)

将您的论坛放在卷轴内。

        

            <s:Scroller height="100%" width="100%">
                <s:DataGroup dataProvider="{someData}" width="100%" height="100%">

                    <s:layout>
                        <s:VerticalLayout gap="1"/>
                    </s:layout>

                </s:DataGroup>

            </s:Scroller>
    </s:Group>

相关问题