我正在从adobe flex迁移到Extjs4,我注意到在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();
这两个按钮彼此之间没有空格。
如何从组件设置空间(间隙或永远)?
谢谢。
发布于 2012-07-03 20:26:39
使用边距配置:
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'
}]
});
});
发布于 2012-07-03 20:19:17
比如保证金?您可以通过样式属性来添加它。查看这个ex http://jsfiddle.net/nscrob/5rn8C/5/
https://stackoverflow.com/questions/11310526
复制相似问题