0
我使用的是最後一個Flex 4 sdk Hero。 我用InteractionMode =「Touch」設置了一個經典的List組件。因此,我的垂直滾動條是不可見的,直到我拖動列表,這是正常的。 我的客戶要求我在列表中添加一些「向下翻頁」按鈕。我已經做了如下,它完美地工作:Flex 4 List with InteractionMode Touch:如何強制滾動條可見
private function handleDownButton(event:*):void {
var currentPosition:Number = wcList.scroller.viewport.verticalScrollPosition;
var nextPosition:Number = currentPosition+((wcList.dataGroup.layout) as VerticalLayout).getVerticalScrollPositionDelta(NavigationUnit.PAGE_DOWN);
var anim:Animate = new Animate(wcList.scroller.viewport);
anim.motionPaths = new <MotionPath>[
new MotionPath("verticalScrollPosition")];
anim.motionPaths[0].keyframes = new <Keyframe>[
new Keyframe(0), new Keyframe(500, nextPosition)];
anim.play();
if ((nextPosition+wcList.height)>=wcList.scroller.viewport.contentHeight) {
buttonDown.enabled=false;
}
buttonUp.enabled = true;
}
我的大問題是,我的客戶也希望在動畫過程中垂直滾動條是可見的,但我不能找到一個解決方案( wcList.scroller.verticalScrollBar.visible = true根本不起作用)。
任何想法如何做到這一點?
謝謝。