当我尝试通过视口向上或向下滚动滚动条中的内容时,我遇到了问题。
我的MXML鳕鱼是
<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
答案 0 :(得分:1)
尝试移除高度和高度来自小组的宽度
<s:Group width="100%" height="100%" >
//-->
<s:Group>
你还需要
<s:Group clipAndEnableScrolling="true" >
答案 1 :(得分:0)
尝试这样做:
scroller.verticalScrollBar.value += 15;