0
votes
<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);

I have tabgroup which has window which has the title 'Fav'.

Title occupay one line at the top of window, but

I would like to put the button next to the title in the title bar.

thanks to Mike S.

I have updated the code, but it doesn't work.

it shows no error but no button appears.

Could I have more hint?

2

2 Answers

1
votes

You can add the nav buttons in the Alloy markup, as well:

<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
votes

Yes, you can. Window has a method called setLeftNavButton() and one for the right side as well.