Flex Spark 视口滚动问题?

发布于 2024-12-03 15:16:36 字数 3123 浏览 2 评论 0原文

当我尝试通过视口向上或向下滚动滚动条中的内容时,我遇到了问题。

我的 MXML cod 是

 <s:BorderContainer width="100%" cornerRadius="3" backgroundColor="#999AAA" 
                       borderAlpha="0" borderColor="#999AAA" backgroundAlpha="0">
        <s:layout>
            <s:VerticalLayout paddingTop="0" horizontalAlign="left" />
        </s:layout>

        <s:Scroller id="id_Scroller" width="100%" height="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off" >
            <s:Group width="100%" height="100%" >
                <s:layout>
                    <s:VerticalLayout paddingTop="2" horizontalAlign="center" gap="1" clipAndEnableScrolling="true"/>
                </s:layout>

                <vitals:VBVitalsGridPanel id="id_VBVitalsGridPanel" width="100%" ExpandedView="true"  allowSlideOut="true"
                                          QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                          QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                          />
                <cc:VBCCHPIGridPanle width="100%" ExpandedView="false" id="id_hpi" allowSlideOut="true"
                                     QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                     QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                     />
                <ros:VBROSGridPanel width="100%" ExpandedView="false" id="id_ros" allowSlideOut="true"
                                    QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                    QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                    />
                <physical:VBPhysicalGridView width="100%" ExpandedView="false" id="id_physical" allowSlideOut="true"
                                             QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                             QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                             />

                <lab:VBLabViewPanel width="100%" ExpandedView="false" id="id_lab" allowSlideOut="true"
                                    QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                    QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                    />
            </s:Group>
        </s:Scroller>
    </s:BorderContainer>

,我的滚动函数在这里,

public function ScrollUp():void
        {
            id_Scroller.viewport.verticalScrollPosition +=  15;
            trace(' -->> '+ id_Scroller.viewport.verticalScrollPosition)
        }

        public function ScrollDown():void
        {
            id_Scroller.viewport.verticalScrollPosition -= 15;
        }

当我向上滚动时,我总是得到 15。

为什么?

请帮助我THNAKS

I face a problem while i am try to scroll up or down the content in a scroller via viewport.

my MXML cod is

 <s:BorderContainer width="100%" cornerRadius="3" backgroundColor="#999AAA" 
                       borderAlpha="0" borderColor="#999AAA" backgroundAlpha="0">
        <s:layout>
            <s:VerticalLayout paddingTop="0" horizontalAlign="left" />
        </s:layout>

        <s:Scroller id="id_Scroller" width="100%" height="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off" >
            <s:Group width="100%" height="100%" >
                <s:layout>
                    <s:VerticalLayout paddingTop="2" horizontalAlign="center" gap="1" clipAndEnableScrolling="true"/>
                </s:layout>

                <vitals:VBVitalsGridPanel id="id_VBVitalsGridPanel" width="100%" ExpandedView="true"  allowSlideOut="true"
                                          QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                          QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                          />
                <cc:VBCCHPIGridPanle width="100%" ExpandedView="false" id="id_hpi" allowSlideOut="true"
                                     QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                     QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                     />
                <ros:VBROSGridPanel width="100%" ExpandedView="false" id="id_ros" allowSlideOut="true"
                                    QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                    QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                    />
                <physical:VBPhysicalGridView width="100%" ExpandedView="false" id="id_physical" allowSlideOut="true"
                                             QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                             QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                             />

                <lab:VBLabViewPanel width="100%" ExpandedView="false" id="id_lab" allowSlideOut="true"
                                    QSSlideStateChange="slideoutManager.QSAutoSlideChangeHandler(event)"
                                    QSViewStateChange="slideoutManager.QSAutoCollapseHandler(event)"
                                    />
            </s:Group>
        </s:Scroller>
    </s:BorderContainer>

and my function for scrolling is here,

public function ScrollUp():void
        {
            id_Scroller.viewport.verticalScrollPosition +=  15;
            trace(' -->> '+ id_Scroller.viewport.verticalScrollPosition)
        }

        public function ScrollDown():void
        {
            id_Scroller.viewport.verticalScrollPosition -= 15;
        }

I am always got 15 when i scroll Up.

Why?

Pls help me THNAKS

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

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

发布评论

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

评论(2

二智少女 2024-12-10 15:16:36

尝试删除高度和组的宽度

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

你还需要

<s:Group clipAndEnableScrolling="true" >

Try removing the height & width from the group

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

Also you need

<s:Group clipAndEnableScrolling="true" >
自演自醉 2024-12-10 15:16:36

尝试这样做:

scroller.verticalScrollBar.value += 15;

Try doing this instead:

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