【发布时间】:2014-09-27 02:21:38
【问题描述】:
我有一个 3x2 的组件面板,看起来像这样:
它使用表格布局(我猜这是最适合这项工作的布局)。但是,当我加宽窗口时,内部组件不会拉伸:
我的代码如下所示:
v = Ext.create('Ext.window.Window', {
renderTo: document.body,
layout: {
type: 'table',
columns: 3,
tdAttrs: { style: 'padding: 3px;' }
},
items: [
{
xtype: 'label',
text: 'Field 1'
},
{
xtype: 'label',
text: 'Field 2'
},
{
xtype: 'label',
text: 'Field 3'
},
{
xtype: 'textfield'
},
{
xtype: 'textfield'
},
{
xtype: 'combobox'
}
]
}
);
v.show()
如您所见,我正在使用表格布局。它似乎将组件像砖一样放置,没有任何拉伸规则。这种情况有更好的布局吗?我在想也许 hBox 有三个面板,然后在面板内你会有 vBox。但这似乎有点麻烦。
小提琴在这里:
【问题讨论】:
-
“我猜这是最适合这项工作的布局”。不是,使用 hbox 布局。