I'm using a custom view and assigning it as a window's titleControl
in order to customize the window's title. It works fine, even when the window is the window
property on a Ti.UI.iPad.NavigationGroup, except when I go to open a new window in the NavigationGroup.
index.xml
:
<Alloy> <Window> <!-- Root window to attach the NavigationGroup to --> </Window> <Window id="contentPanel" /> </Alloy>
index.js
:
nav = Ti.UI.iPhone.createNavigationGroup({ window: $.contentPanel, top: 0, left: 60, width: Alloy.globals.deviceWidth, height: Alloy.globals.deviceHeight }); contentPanel.setTitleControl(myTitleControl); $.index.add(nav);
This works. My custom title control shows up and it looks great.
However, later on when I do something like this:
nav.open(Alloy.createController('newAction').getView());
The navigation control animates a new window and shows a "Back" button like it should, but the title bar is the default iOS grey. My desired effect is for the title bar to still have my title control.
I've tried adding my custom title control to $.index
instead of $.contentPanel
but that doesn't work.
I've also tried modularizing my custom title control and adding it as the titleControl of the window I'm opening in the Navigation Group ('newAction' in my example), but that hasn't worked either.
Any ideas on how to have a custom titleControl throughout the entire iPad app, regardless of Navigation Group use?