Android Sencha Touch 2-仅在构建后,转盘卡在第一个面板上

Android Sencha Touch 2-仅在构建后,转盘卡在第一个面板上,android,ios,extjs,sencha-touch-2,carousel,Android,Ios,Extjs,Sencha Touch 2,Carousel,在我通过sencha sdk构建应用程序之前,我在面板中有一个旋转木马,它可以正常显示和工作。但是,在我构建它之后,旋转木马仍然可以正常显示,但不再允许我在项目之间滑动 Ext.define('SycsApp.view.HotOffers', { extend: 'Ext.Panel', requires: ['Ext.carousel.Carousel', 'Ext.TitleBar'], config: { layout: 'card',

在我通过sencha sdk构建应用程序之前,我在面板中有一个旋转木马,它可以正常显示和工作。但是,在我构建它之后,旋转木马仍然可以正常显示,但不再允许我在项目之间滑动

Ext.define('SycsApp.view.HotOffers', {
    extend: 'Ext.Panel',
    requires: ['Ext.carousel.Carousel', 'Ext.TitleBar'],

    config: {
            layout: 'card',
            items: [
                {
                    docked: 'top',
                    xtype: 'titlebar',
                    ui: 'top-sub',
                    title: 'Hot Offers',
                },
                {
                    id: 'hotOffersCarousel',
                    xtype: 'carousel',
                    width: '100%',
                    items: [
                        {
                            html : 'Item 1',
                            style: 'background-color: #5E99CC'
                        },
                        {
                            html : 'Item 2',
                            style: 'background-color: #759E60'
                        },
                        {
                            html : 'Item 3'
                        }
                    ]
                }
            ]
    }
});
布局设置为“卡片”的原因是该视图是包含选项卡面板的一部分。在构建之后运行应用程序时,我也不会从控制台收到任何错误消息


如果您能提供任何帮助,解释为什么会发生这种情况,我们将不胜感激。

此问题是由于将其添加到主卡视图的方式造成的

Ext.define('SycsApp.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'mainView',
requires:  ['SycsApp.view.HotOffers'],

config: {
    tabBarPosition: 'bottom',
    id: 'MainView',
    ui: 'bottom',
    layout: 'card',
    items: [
        {
            title: 'Hot Offers',
            layout: 'fit',
            iconCls: 'hotoffer',
            //items: [Ext.create('SycsApp.view.HotOffers')], // carousel doesn't work after build
            items:  [{xtype: 'hotOffersView'}] // carousel works after build
        },
        {
            title: 'All Savings',
            layout: 'fit',
            iconCls: 'list',
            items:  [{xtype: 'allSavingsMainView'}]
        }
    ]
}
}))

必须将
xtype:“HotOfferView”
添加到Hot Offers视图:

Ext.define('SycsApp.view.HotOffers', {
    extend: 'Ext.Panel',
    xtype: 'hotOffersView',
    requires: ['Ext.carousel.Carousel', 'Ext.TitleBar'],

    config: {
            layout: 'card',
            items: [
                {
                    docked: 'top',
                    xtype: 'titlebar',
                    ui: 'top-sub',
                    title: 'Hot Offers',
                },
                {
                    id: 'hotOffersCarousel',
                    xtype: 'carousel',
                    width: '100%',
                    items: [
                        {
                            html : 'Item 1',
                            style: 'background-color: #5E99CC'
                        },
                        {
                            html : 'Item 2',
                            style: 'background-color: #759E60'
                        },
                        {
                            html : 'Item 3'
                        }
                    ]
                }
            ]
    }
});