2011-09-12 64 views
1

我曾尝试没有成功如下:如何在sencha touch中将按钮对齐到工具栏上的左侧和右侧?

items:[myapp.buttons.resultsPrevious, {xtype: 'spacer'}, myapp.buttons.resultsNext] 

items:[myapp.buttons.resultsPrevious, '->', myapp.buttons.resultsNext] 

其中数据项相关工具栏的项目。

而且我还试图用按钮的align属性:

align: 'left' 
在按钮配置

,但这并不能工作。

任何提示赞赏。谢谢。

回答

4

工具栏必须配置布局属性:

layout: { 
    pack: 'left' 
}, 
+0

如何将1个按钮对齐到另一个右边? –

1

然后我们必须使用停靠属性对齐按钮左侧或右侧。

xtype: 'toolbar', 
     docked: 'bottom',   
     items: 
     [ 
      { 
       xtype: 'button', 
       id:'btn1', 
       html:"left btn", 
       docked: 'left'     
      }, 
      { 
       xtype: 'button', 
       id:'btn2', 
       html:'right btn, 
       docked: 'right'     
      } 

     ] 
相关问题