Flex Spark 视口滚动问题?
当我尝试通过视口向上或向下滚动滚动条中的内容时,我遇到了问题。
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试删除高度和组的宽度
你还需要
Try removing the height & width from the group
Also you need
尝试这样做:
Try doing this instead: