2011-06-15 90 views
0

我第一次使用Sencha觸摸,我設法得到一些菜單項來顯示,但我想它移動/向右移動是任何人確定如何做到這一點?Sencha觸摸浮動/向右移動

這是我的按鈕的代碼:

spaceosaur.views.Home = Ext.extend(Ext.Panel, { 
initComponent: function(){ 

this.dockedItems = [{ 
     xtype: 'toolbar', 
     title: 'Spaceosaur', 
     items: [     
      { xtype: 'segmentedbutton', items: [ 
       { iconMask: true, iconCls: '', text: 'Featured', pressed : true }, 
       { iconMask: true, text: 'Latest' }, 
       { iconMask: true, text: 'Popular' }, 
      ]}, 
      { iconMask: true, ui: 'action', text: 'Refresh' }, 

     ] 
    }] 

    spaceosaur.views.Home.superclass.initComponent.call(this); 
} 

});

Ext.reg('home',spaceosaur.views.Home);

和站點的一個例子是在這裏:http://cameronmlewis.com/pad/

回答

1

更改工具欄按鈕的排列,最簡單的方法是添加spacers

要對齊東西,你可以做以下權利:

items: [ 
    {xtype: 'spacer'}, 
    { iconMask: true, ui: 'action', text: 'Refresh' } 
] 

間隔將推動一切的權利。您可以使用spacer和/或按鈕的寬度屬性來創造靈活性,以便將所有內容都放到空間並正確排列。