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

时间:2012-11-26 18:39:42

标签: extjs extjs3

我正在尝试将一些文本垂直居中在ExtJS面板中。我有这个作为一个kludge但我想知道正确的方法?

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'
            }]
    });

以下是我最终使用以下答案实施的内容:

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'
            }]
    });

1 个答案:

答案 0 :(得分:1)

我认为您应该能够将面板布局设置为“hbox”并使用pack'center',或者使用hbox布局和打包中心将容器嵌套在面板中。

相关问题