开发者

How to align buttons to left and right on toolbar in sencha touch?

I have tried the following with no success:

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

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

Where items are the items of the relevant toolbar.

And I have also tried to use the align property of th开发者_运维知识库e buttons:

align: 'left'

in the configuration for the buttons, but that doesn't work either.

Any tips appreciated. Thanks.


The toolbar must have the layout property configured:

layout: {
  pack: 'left'
},


Then we have to use docked property for aligning the button right or left.

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

        ]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜