有没有办法扩展此代码以滑动到此代码中的 3 个以上视图?
主.MXML
private function handleSwipe(event:TransformGestureEvent):void
{
var slideViewTransition:SlideViewTransition = new SlideViewTransition();
// Swipe was to the right
if (event.offsetX == 1 ) {
slideViewTransition.direction = ViewTransitionDirection.RIGHT;
navigator.pushView( PreviousView, null, null, slideViewTransition );
}
// Swipe was to the left
else if (event.offsetX == -1 ) {
slideViewTransition.direction = ViewTransitionDirection.LEFT;
navigator.pushView( NextView, null, null, slideViewTransition );
}
}
下一个视图.MXML
import spark.transitions.SlideViewTransition;
import spark.transitions.ViewTransitionDirection;
private function handleSwipe(event:TransformGestureEvent):void
{
var slideViewTransition:SlideViewTransition = new SlideViewTransition();
if (event.offsetX == 1 ) {
slideViewTransition.direction = ViewTransitionDirection.LEFT;
navigator.pushView( ThreeView, null, null, slideViewTransition );
}
}