javascript - 如何对齐工具栏上的按钮?

标签 javascript css extjs sencha-touch

在 Sencha Touch 应用程序中,我正在设计布局,但按钮的位置有问题..

我的代码是:

  config    : {
    cls: 'survey-header-edition',
    xtype: 'container',
    layout: {
      pack: 'center',
      type: 'vbox'
    },
    items: [
      {
        xtype: 'toolbar',
        layout: {
          pack: 'center',
          type: 'vbox'
        },
        items: [
          {
            xtype: 'label',
            cls   : 'survey-header-template',
            itemId: 'surveyHeaderTemplate'
          },
          {
            xtype: 'label',
            cls   : 'survey-header-customerId',
            itemId: 'surveyHeaderCustomerId'
          }
        ]
      },
      {
        xtype: 'toolbar',
        layout: {
          pack: 'center',
          type: 'hbox'
        },
        items:[
          {
            xtype     : 'segmentedbutton',
            itemId    : 'matrixSegmentedButton',
            cls: 'matrixSegmentedButton',
            items     : [
              {
                itemId  : 'presenceData',
                iconMask: true,
                pressed : true
              },
              {
                itemId  : 'auxiliaryFields',
                iconMask: true
              },
              {
                itemId  : 'profiles',
                iconMask: true
              },
              {
                itemId  : 'photos',
                iconMask: true
              }
            ]
          },
          {
            xtype : 'button',
            layout: {
              pack: 'end',
              type: 'vbox'
            },
            itemId: 'actionsButton',
            cls   : 'actionsButton',
            text  : 'actions'
          }
        ]
      }
    ]
  },

还有名为 actionsButton 的按钮 我想将此按钮右对齐,但我不能..有什么线索吗?

最佳答案

您可以使用 spacer为此:

{
    xtype : 'toolbar',
    docked: 'top',
    title: 'My Toolbar',
    items: [{
        text: 'left'
    }, {
        xtype: 'spacer'
    }, {
        text: 'right'
    }]
}

关于javascript - 如何对齐工具栏上的按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33646731/

相关文章:

javascript - 动画字母很容易?

javascript - EXTJS 从商店内容创建复选框

javascript - ExtJS:将模型列转换为网格中的行

javascript - jquery自动滚动展厅

javascript - 如何将文本从一个div传递到另一个div

javascript - 谷歌地图 : when I put an anchor, 市场成为默认

html - 如何在 css 中为所有子类正确设置样式?

jquery:当div达到一定高度时改变背景颜色

javascript - 关于ExtJs4 MVC架构

javascript - 无法加载位于我的计算机上的 JSON 文件