【发布时间】:2025-12-30 00:55:12
【问题描述】:
我正在尝试制作可调整大小的面板布局。我做了一个小提琴:
https://fiddle.sencha.com/#view/editor&fiddle/3c94
为什么在 test3 和 test4 之间的调整器工作时,我不能在 test1 和 test2 之间使用调整器。
我尝试将 flex/fit 添加到一些容器中,尝试删除不重要的东西,但找不到解决方案。
【问题讨论】:
我正在尝试制作可调整大小的面板布局。我做了一个小提琴:
https://fiddle.sencha.com/#view/editor&fiddle/3c94
为什么在 test3 和 test4 之间的调整器工作时,我不能在 test1 和 test2 之间使用调整器。
我尝试将 flex/fit 添加到一些容器中,尝试删除不重要的东西,但找不到解决方案。
【问题讨论】:
因为您在第一个面板中使用了 fit 布局,而在第二个面板中使用了 hbox(它有效):
Ext.create('Ext.form.Panel', {
xtype: 'main_customer',
itemId: 'main_customer',
renderTo: Ext.getBody(),
flex: 1,
items: [{
xtype: 'panel',
itemId: 'maincontainer',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'panel',
padding: 0,
scrollable: true,
layout: {
type: 'hbox',
align: 'stretch'
},
flex: 1,
height: '63%',
resizable: {
split: true,
edges: ['south']
},
items: [{
xtype: 'panel',
resizable: {
split: true,
edges: ['east'],
},
items: [{
xtype: 'panel',
html: 'test 1',
}]
}, {
xtype: 'panel',
html: 'test 2',
}]
}, {
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
flex: 1,
items: [{
xtype: 'panel',
width: '50%',
resizable: {
split: true,
edges: 'east'
},
html: 'test 3',
}, {
xtype: 'panel',
html: 'test 4',
}]
}]
}],
collapsible: false
});
【讨论】: