Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 使用SenchaTouch制作分段按钮以覆盖字段集中的全部可用空间_Sencha Touch_Extjs_Sencha Touch 2 - Fatal编程技术网

Sencha touch 使用SenchaTouch制作分段按钮以覆盖字段集中的全部可用空间

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

如果你看下图,我有一个段按钮,它位于字段集的顶部。我希望分段按钮覆盖字段集中可用的全部空间。我对SegmentedButton使用了以下布局。帮我修一下

 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
        }
    ]
});
现场示例: