0

我有这样的事情:

<j:initialView>
    <j:ResponsiveView>
        <j:ApplicationMainContent width="100%" selectedContent="ssc1">
            <j:ScrollableSectionContent name="ssc1" width="100%" /*also tried height="600"*/ >
                <j:Card height="600" width="200">
                    <j:Label text="A"/>
                    <j:Label text="B"/>
                    <j:ScrollableSectionContent width="100%" height="50">
                        <j:Label text="0"/>
                        <j:Label text="1"/>
                        <j:Label text="2"/>
                        <j:Label text="3"/>
                        <j:Label text="4"/>
                        <j:Label text="5"/>
                        </j:ScrollableSectionContent>
                    <j:Label text="C"/>
                </j:Card>
            </j:ScrollableSectionContent>
        </j:ApplicationMainContent>
    </j:ResponsiveView>
</j:initialView>

我不明白为什么它不起作用。上面的例子只显示 ABC :

在此处输入图像描述

如何在j:Card50px 高度的滚动视图中进行操作(在我的示例中以可滚动内容显示 0、1、2、3、4、5)?

我希望父容器是 ScrollableSectionContent 因为如果我将浏览器窗口设置为低于 600px 我希望能够滚动浏览器窗口内容以显示Card内容

问候

4

2 回答 2

1

正如卡洛斯所说,我的示例是使用 ScrollingViewport,这是完整的工作代码:

<j:initialView>
        <j:ResponsiveView>
            <j:ApplicationMainContent width="100%" selectedContent="ssc1">
                <j:ScrollableSectionContent name="ssc1" width="100%" >
                    <j:Card height="600" width="200">
                        <j:Label text="A"/>
                        <j:Label text="B"/>

                        <j:VGroup height="50" width="100%" gap="1">
                            <j:beads>
                                <j:ScrollingViewport/>
                            </j:beads>
                            <j:Label text="0"/>
                            <j:Label text="1"/>
                            <j:Label text="2"/>
                            <j:Label text="3"/>
                            <j:Label text="4"/>
                            <j:Label text="5"/>
                        </j:VGroup>

                        <j:Label text="C"/>
                    </j:Card>
                </j:ScrollableSectionContent>
            </j:ApplicationMainContent>
        </j:ResponsiveView>
    </j:initialView>

给这个:

在此处输入图像描述

于 2020-12-16T17:44:03.103 回答
0

SectionContent(and ScrollableSectionContent) 默认情况下不可见。最初的目的是将其用于导航,因此我们创建了所有内容,并且只使选定的内容可见。

所以你需要设置isSelected="true"让它可见。

也许我们可以默认使其可见,然后在导航容器中使用时使其不可见...

如果您只想拥有一个可滚动区域,您可以添加一个带有ScrollingViewport珠子的可用容器。

于 2020-12-16T13:37:22.153 回答