Sencha touch Sencha touch::使选项卡面板始终滑动';左';

Sencha touch Sencha touch::使选项卡面板始终滑动';左';,sencha-touch,slide,tabpanel,Sencha Touch,Slide,Tabpanel,有没有办法让选项卡面板在sencha touch中始终“向左”滑动?我想您可以这样做(抱歉,现在无法测试): @我认为这很复杂,我修改了上面的答案。这将创建一个自定义动画(从幻灯片复制)。这是一个困难的动画,您可能认为这很容易。在选项卡面板上,您可以设置参数cardSwitchAnimation:“slide”,这将在打开新选项卡(1->2->3)时启用向右滑动。然而,当滚动“后退”时(1 new Ext.TabPanel({ fullscreen: true, defaults:{animat

有没有办法让选项卡面板在sencha touch中始终“向左”滑动?

我想您可以这样做(抱歉,现在无法测试):


@我认为这很复杂,我修改了上面的答案。这将创建一个自定义动画(从幻灯片复制)。这是一个困难的动画,您可能认为这很容易。在选项卡面板上,您可以设置参数
cardSwitchAnimation:“slide”
,这将在打开新选项卡(1->2->3)时启用向右滑动。然而,当滚动“后退”时(1
new Ext.TabPanel({
fullscreen: true,
defaults:{animation: new Ext.Anim({
    direction: 'left',
    cover: false,
    reveal: false,

    before: function(el) {
        var curZ = el.getStyle('z-index') == 'auto' ? 0 : el.getStyle('z-index'),
            zIndex = curZ + 1,
            toX = 0,
            toY = 0,
            fromX = 0,
            fromY = 0,
            elH = el.getHeight(),
            elW = el.getWidth();

        if (this.direction == 'left' || this.direction == 'right') {
            if (this.out == true) {
                toX = -elW;
            }
            else {
                fromX = elW;
            }
        }
        else if (this.direction == 'up' || this.direction == 'down') {
            //if (this.out == true) {
            //    toY = -elH;
            //}
            //else {
                fromY = elH;  //Always slide to the left???
            //}
        }

        if (this.direction == 'right' || this.direction == 'down') {
            toY *= -1;
            toX *= -1;
            fromY *= -1;
            fromX *= -1;
        }

        if (this.cover && this.out) {
            toX = 0;
            toY = 0;
            zIndex = curZ;
        }
        else if (this.reveal && !this.out) {
            fromX = 0;
            fromY = 0;
            zIndex = curZ;
        }

        this.from = {
            '-webkit-transform': 'translate3d(' + fromX + 'px, ' + fromY + 'px, 0)',
            'z-index': zIndex,
            'opacity': 0.99
        };
        this.to = {
            '-webkit-transform': 'translate3d(' + toX + 'px, ' + toY + 'px, 0)',
            'z-index': zIndex,
            'opacity': 1
        };
    }
})
},
items: [
    {
        title: 'Tab 1',
        html : '1',
        cls  : 'card1'
    },
    {
        title: 'Tab 2',
        html : '2',
        cls  : 'card2'
    },
    {
        title: 'Tab 3',
        html : '3',
        cls  : 'card3'
    }
]
});