【问题标题】:extjs - center a formPanel on a web pageextjs - 在网页上居中 formPanel
【发布时间】:2014-05-25 03:36:36
【问题描述】:

使用 extjs,我有一个固定宽度的 formPanel。我想在一个普通的 web 页面中居中这个表单,所以即使我最小化浏览器,表单也会出现在中心。我没有使用外部容器,只是一个带有 html/css 页面的简单表单面板。所以以下在我的情况下不起作用:

layout: {
        type: 'vbox',
        align: 'center',
        pack: 'center'
    },
    items: [{
        title: 'Centered Panel',
        width: 200,
        height: 200
    }]

【问题讨论】:

    标签: html css extjs


    【解决方案1】:

    使用flex = 1 的另外两个容器(左和右)并将布局更改为hbox

    layout: {
        type: 'hbox'
    },
    items: [{
        xtype: 'container',
        flex: 1
    },{
        title: 'Centered Panel',
        width: 200,
        height: 200
    },    {
        xtype: 'container',
        flex: 1
    }]
    

    【讨论】:

      猜你喜欢
      • 2011-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      • 2011-07-24
      • 2011-02-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多