2012-02-07 96 views
2

为什么我在页面更改时没有获得幻灯片效果?这里是我的代码卡中没有幻灯片动画

launch: function() { 
     var panel = Ext.create('Ext.Panel', { 
      layout: 'card', 
      fullscreen: true, 
      items: [ 
       { 
        html: "Splash Screen<img src='images/logo.png' />" 
       }, 
       { 
        html: "Login Screen<img src='images/logo.png' />" 
       }, 
       { 
        html: "About Screen" 
       }, 
       { 
        html: "User Screen" 
       } 
      ] 
     }); 

     panel.setActiveItem(0); 

     setTimeout(function(){ 
      panel.setActiveItem(1); 
     },3000); 

3秒我得到的登录界面后,但没有任何幻灯片动画。我在铬和ipad模拟器中都检查过。

回答

1

试试你的setTimeout里面是这样的:

panel.setActiveItem(1, {type:'slide', direction:'left'}); 

我相信你也可以更改您的[布局:“卡”]行来这样的事情来达到同样的效果:

layout: { 
      type: 'card', 
      animation: { 
       type: 'slide', 
       direction: 'left' 
      } 
     } 
6

setActiveItem()在ST2中不显示动画。你需要如果您正在使用Sencha Touch 2.0.0,新版本比使用,

yourpanel.animateActiveItem(0, { type: 'slide', direction: 'right' }) 

请通过此链接了解更多信息,与

panel.animateActiveItem(1, {type:'slide', direction:'left'});