Sencha touch 2 子面板不可见

Sencha touch 2 子面板不可见,sencha-touch-2,Sencha Touch 2,我试图在面板中添加面板,但子面板始终隐藏。检查firebug时,我发现子面板的内容在那个里,但因为它的宽度/高度并没有设置,所以它是不可见的。这是我的家长小组 ...{ items: [subCards] }... 这是我的名片 var subCards = Ext.create('Ext.Panel', { layout : { type : 'card', animation : { type : 'slide',

我试图在面板中添加面板,但子面板始终隐藏。检查firebug时,我发现子面板的内容在那个里,但因为它的宽度/高度并没有设置,所以它是不可见的。这是我的家长小组

...{
    items: [subCards]
}...
这是我的名片

var subCards = Ext.create('Ext.Panel', {
    layout : {
        type : 'card',
        animation : {
            type : 'slide',
            direction: 'left'
        }
    },
    activeItem: 0,
    items: [
        {
            style: "background-color: #3f3f3f;",
            html: 'Wellcome screen'
        },
        {
            style: "background-color: #3f3f3f;",
            html: 'SEcond screen'
        },
        {
            html: "third screen"
        },
        {
            html: '4th screen'
        }
    ]
});

如果使用
卡布局
,则只能有一个
活动项

尝试创建一个如下所示的
视口

Ext.define('MyApp.view.Viewport', {
extend : 'Ext.Container',
xtype  : 'myapp-viewport',

config : {
    fullscreen : true,
    layout     : 'card',
    items      : [
        /**
         * Here you can specify any items on the top toolbar
         */
        {
            xtype        : 'toolbar',
            docked       : 'top',
            title        : 'Title',
            defaultTitle : 'Title',
            items        : [
                {
                    text   : 'Back',
                    ui     : 'back',
                    hidden : true
                }
            ]
        },
        /**
         * Here you can specify any items on the bottom toolbar
         */
        {
            xtype  : 'toolbar',
            docked : 'bottom',
            title  : 'Bottom'
        },
        /**
         * Here you can specify any items to show up as content
         */
        {
            xtype : 'myapp-content'
        }
    ]
}
});
上面我们将内容定义为xtype
maypp content
,因此您可以在此处添加子卡:

Ext.define('MyApp.view.ListWrap', {
extend : 'Ext.Container',
xtype  : 'myapp-listwrap',

config : {
    layout : {
        type  : 'vbox',
        align : 'stretch'
    },
    items  : [
        {
            html : 'Image Here',
            flex : 1
        },
        /**
         * Here you can specify any other sub-sub layouts, just use the xtype
         */
        {
            //xtype : 'mvctest-list',
            html  : 'Another image can be on this place',
            flex  : 3
        }
    ]
}
});
如果这仍然不能帮助您,请发布包含子命令的te父视图代码。干杯