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

发布于 2024-10-03 10:14:03 字数 1136 浏览 4 评论 0原文

我在使用 ClipAndEnableScrolling 时遇到一些问题,当父级具有固定高度时,它对于 VGroup 工作正常,但如果父级没有固定高度,则它不起作用并且内容会溢出。例如:

      <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>

这是一个人为的例子,但重点是我不提前知道第一组的高度,所以无法设置第二组的高度,而且现实中的组件要复杂得多上面的例子是这样的,所以我不想进行任何类型的体操来计算第二组以上所有物体的高度。

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

干杯,

克里斯

I am having some problems with clipAndEnableScrolling, it works fine for VGroup when the parent has fixed height, but if the parent doesn't have a fixed height then it doesn't work and the content spills over. 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>

This is a contrived example, but the point is that I don't know the hight of the first group ahead of time so can't set the height of the second group, also the component in reality is quite a lot more complex that the contrived example above so I don't want to have to perform any kind of gymnastics to calculate the heights of everything above the second Group.

Can anyone tell me how to get a scrollbar on the second group?

Cheers,

Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌伤浅笑 2024-10-10 10:14:03

你可以尝试将所有组的高度设置为 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>

Can you try setting height to 100% upon all the groups, something like this

 <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>
春风十里 2024-10-10 10:14:03

将您的组放入滚动条中。

            <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>

Put your group inside the scroller.

            <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>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文