我正在从 adobe flex 迁移到 ext js 4,我注意到在 Extjs 中,组件放置得太近。那时之间没有差距。这可以面对这个例子:
var win = Ext.create('Ext.window.Window', {
layout: 'hbox',
height: 500,
width: 400,
title: 'hbox',
items: [
Ext.create('Ext.button.Button',
{
text: 'My button 1',
width: 150
}),
Ext.create('Ext.button.Button',
{
text: 'My button 2',
width: 150
})
]
});
win.show();
两个按钮彼此之间的间距为零。
如何设置组件之间的空间(间隙或曾经)?
谢谢。
最佳答案
使用边距配置:
Ext.onReady(function() {
var win = Ext.create('Ext.window.Window', {
layout: 'hbox',
height: 500,
width: 400,
autoShow: true,
title: 'hbox',
defaultType: 'button',
items: [{
text: 'My button 1',
width: 150,
margin: '10 20 30 40'
}, {
text: 'My button 2',
width: 150,
margin: '40 30 20 10'
}]
});
});
关于extjs - 如何在 Ext js 4 布局中的组件之间插入空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11310526/