2012-03-20 23 views
1

我爲此搜索了很多,但我似乎沒有找到任何有關如何做到這一點的線索。 相當整齊確實在廚房水槽什麼煎茶如下:Sencha Touch 2像導航的廚房水槽

  • 導航欄停靠在停靠在顯示視圖的標題頂部左側
  • 工具欄。

我似乎無法弄清楚如何做到這一點,即使通過廚房水槽的源代碼吐痰。我確實發現了一些關於如何但尚未完成的痕跡。

showViewById: function(id) { 
    var nav = this.getNav(), 
     view = nav.getStore().getNodeById(id); 

    this.showView(view); 
    this.setCurrentDemo(view); 
    this.hideSheets(); 
}, 

這不是全部。

你能滿足我的某種教程如何創建這種類型的佈局?還是幫我進一步?

+0

您是否在問如何創建一個看起來像Sencha Touch而不實際使用它的頁面?這就是我想弄明白的,這就是我解釋你的問題的方式,但你接受的答案似乎表明我可能對此有錯。 – Michael 2013-01-05 21:03:39

+0

@Michael如果你看看Sencha Touch的Kitchensink http://cdn.sencha.io/touch/sencha-touch-2.1.0/examples/kitchensink/你會看到它有特殊的導航。我想在Sencha Touch 2 – 2013-01-06 14:03:34

回答

4

看看Main.js文件(Kitchensink.view.tablet.Main)。這個類基本上,創建你所談論的佈局..它是直截了當:

items: [ 
    {  // This is the content area... 
     id: 'launchscreen', 
     cls : 'card', 
     scrollable: true, 
     html: 'Home page content' 
    }, 
    { 
     // The left navigation 
     id: 'mainNestedList', 
     xtype : 'nestedlist', 
     useTitleAsBackText: false, 
     docked: 'left', 
     width : 250, 
     store: 'Demos' 
    }, 
    { 
     // The top toolbar 
     id: 'mainNavigationBar', 
     xtype : 'titlebar', 
     docked: 'top', 
     title : 'Kitchen Sink', 
     items: { 
      xtype : 'button', 
      id: 'viewSourceButton', 
      hidden: true, 
      align : 'right', 
      ui : 'action', 
      action: 'viewSource', 
      text : 'Source' 
     } 
    } 
] 

這應該幫助您開始。

+0

中也一樣感謝這給了我想要的順序:),而且我只需在啓動屏幕中切換視圖,即可獲得我想要的功能。 – 2012-03-21 12:44:26