Sencha touch 使用SenchaTouch制作分段按钮以覆盖字段集中的全部可用空间
如果你看下图,我有一个段按钮,它位于字段集的顶部。我希望分段按钮覆盖字段集中可用的全部空间。我对SegmentedButton使用了以下布局。帮我修一下Sencha touch 使用SenchaTouch制作分段按钮以覆盖字段集中的全部可用空间,sencha-touch,extjs,sencha-touch-2,Sencha Touch,Extjs,Sencha Touch 2,如果你看下图,我有一个段按钮,它位于字段集的顶部。我希望分段按钮覆盖字段集中可用的全部空间。我对SegmentedButton使用了以下布局。帮我修一下 var btn = new Ext.SegmentedButton({ layout: { type : 'hbox', pack : 'center', align: 'stretchmax' }, allowMulti
var btn = new Ext.SegmentedButton({
layout: {
type : 'hbox',
pack : 'center',
align: 'stretchmax'
},
allowMultiple: false,
items: [
{
text: 'Switch 1',
widht:'100%',
labelWidth : '100%',
modal: true,
pressed: true
},
{
text : 'Switch 2',
widht:'100%',
labelWidth :'100%',
modal: true
}
]
});
您有
widt
而不是width
,您需要将其设置为50%,而不是100%
var btn = new Ext.SegmentedButton({
layout: {
type : 'hbox',
pack : 'center',
align: 'stretchmax'
},
allowMultiple: false,
items: [
{
text: 'Switch 1',
width:'50%',
labelWidth : '100%',
modal: true,
pressed: true
},
{
text : 'Switch 2',
width:'50%',
labelWidth :'100%',
modal: true
}
]
});
现场示例: