2014-02-11 37 views
0
<Alloy> 
    <TabGroup backgroundColor="white" id="mainTabGroup"> 
     <Tab id="byFav" title="fav" icon="KS_nav_views.png"> 
     <Window id="byFavWin' title='fav'> 
       <TableView id="tableByFav" /> 

      </Window> 
     </Tab> 
    </TabGroup> 
</Alloy> 

index.js有在窗口的標題欄中的按鈕

var backButton = Ti.UI.createButton({left:0, width:80, height:25, backgroundColor:'red'}); 
$.byFavWin.setLeftNavButton(backButton); 

我有tabgroup,其具有的標題爲「最愛」窗口。

標題occupay在窗口頂部的一條線,但

我願把按鈕旁邊的標題在標題欄中。

感謝Mike S.

我更新了代碼,但它不起作用。

它顯示沒有錯誤,但沒有按鈕出現。

我能有更多的提示嗎?

回答

1

您可以添加導航按鈕,在合金標記,以及:

<Alloy> 
    <TabGroup> 
     <Tab> 
      <Window title="Title" layout="vertical" backgroundColor="white"> 
       <LeftNavButton> 
        <Button>pop</Button> 
       </LeftNavButton> 
       <RightNavButton> 
        <Button>push</Button> 
       </RightNavButton> 
      </Window> 
     </Tab> 
    </TabGroup> 
</Alloy> 
+0

非常感謝!它顯示按鈕! – whitebear

0

是的,你可以。窗口有一個名爲setLeftNavButton()的方法,另一個方法也用於右側。

+0

非常感謝你。我已經測試和更新了文章。你有什麼想法嗎? – whitebear

相關問題