Sencha ExtJS-在VBoxLayout中嵌套100%高度的BorderLayout

Sencha ExtJS-在VBoxLayout中嵌套100%高度的BorderLayout,layout,extjs,border,panel,vbox,Layout,Extjs,Border,Panel,Vbox,我试图将BorderLayout放在VBoxLayout中,并使此BorderLayout具有100%的高度。 我尝试: 它工作得很好,但如果我将height:200替换为height:100%,我什么也看不到。 我做错了什么 谢谢你的帮助 (注:VBoxLayout是一项要求,我的应用程序比本例复杂得多,我无法更改VBoxLayout)。我认为您必须将表单flex:0更改为flex:1 Ext.create('Ext.container.Viewport', { layout : 'fit',

我试图将BorderLayout放在VBoxLayout中,并使此BorderLayout具有100%的高度。 我尝试:

它工作得很好,但如果我将height:200替换为height:100%,我什么也看不到。 我做错了什么

谢谢你的帮助


(注:VBoxLayout是一项要求,我的应用程序比本例复杂得多,我无法更改VBoxLayout)。

我认为您必须将表单flex:0更改为flex:1

Ext.create('Ext.container.Viewport', {
layout : 'fit',
items : [
    Ext.create('Ext.panel.Panel', {
        width: '100%',
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        items: [
            Ext.create('Ext.panel.Panel', {
                flex: 0,
                height: 200,
                layout: 'border',
                items: [
                    Ext.create('Ext.panel.Panel', {
                        title: 'toto',
                        region: 'center'
                    })
                ]
            })
        ]
    })

]                           
});