我正在从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();
Run Code Online (Sandbox Code Playgroud)
两个按钮彼此间隔为零.
如何设置组件的空间(间隙或永远)?
谢谢.
Eva*_*oli 19
使用保证金配置:
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'
}]
});
});
Run Code Online (Sandbox Code Playgroud)