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
如何在ExtJS中使面板中的文本垂直居中?_Extjs_Extjs3 - Fatal编程技术网

如何在ExtJS中使面板中的文本垂直居中?

如何在ExtJS中使面板中的文本垂直居中?,extjs,extjs3,Extjs,Extjs3,我试图在ExtJS面板中垂直居中一些文本。我把这当作一个难题,但我想知道正确的方法 var instructions = new Ext.Panel( { height: 40, items: [ { html: '<br>To access an Aircraft Profile, please highlight a row in the table and select the N-

我试图在ExtJS面板中垂直居中一些文本。我把这当作一个难题,但我想知道正确的方法

var instructions = new Ext.Panel(
    {
        height: 40,
        items: [
            {
                html: '<br>To access an Aircraft Profile, please highlight a row in the table and select the N-Number hyperlink displayed in the summary below the table'
            }]
    });

我认为您应该能够将面板布局设置为“hbox”,并使用pack“center”,或者使用hbox布局和pack center在面板内嵌套一个容器

var instructions = new Ext.Panel(
    {
        height: 40,
        layout: 'hbox',
        layoutConfig: {
            align: 'middle'
        },
        items: [
            {
                xtype: 'displayfield',
                value: 'To access an Aircraft Profile, please highlight a row in the table and select the N-Number hyperlink displayed in the summary below the table'
            }]
    });