【问题标题】:carousel panel in sencha-touchsencha-touch 中的旋转木马面板
【发布时间】:2011-07-18 14:21:58
【问题描述】:

我是 sencha-touch 的新手,我已经完成了所有面板和布局教程;但是,我仍然不知道如何将三个不同的轮播卡放入一个面板中。我在一些本机应用程序中看到过这种布局,我想知道这是否可以使用 sencha-touch 完成

【问题讨论】:

  • 我实际上是不小心做到了这一点,但它看起来并不漂亮,也没有达到预期的效果。

标签: sencha-touch carousel


【解决方案1】:

您可以通过在每个轮播窗格中使用样式面板来实现类似的效果。您一次只能分批滚动 3 个。不过,底部的点只会显示总共 3 个面板窗格。比如:

var carousel = new Ext.Carousel({
   items: [
     new Ext.Panel({
         layout: 'hbox',
         items:[
            new Ext.Panel({html: 'card 1'}),
            new Ext.Panel({html: 'card 2'}),
            new Ext.Panel({html: 'card 3'}),
         ]
     }),
     new Ext.Panel({
         layout: 'hbox',
         items:[
            new Ext.Panel({html: 'card 4'}),
            new Ext.Panel({html: 'card 5'}),
            new Ext.Panel({html: 'card 6'}),
         ]
     }),
     ....
});

【讨论】: