Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-815

iOS 7: add 'navigationWindow' API to XML markup

    Details

      Description

      Feature description

      With the new iOS 7 the new "navigationWindow" API has been introduced for handling the navigation logic for iOS 7.

      Using a classic Titanium project, the sample code would be:

      var rootWin = Ti.UI.createWindow({
      	backgroundColor:"white"
      });
       
      var navWin = Ti.UI.iOS.createNavigationWindow({
      	window:rootWin
      });
       
      var secondWin = Ti.UI.createWindow({
      	backgroundColor:"blue"
      });
       
      var b1 = Ti.UI.createButton({
      	title:"PUSH"
      });
      rootWin.add(b1);
       
      var b2 = Ti.UI.createButton({
      	title:"POP"
      });
       
       
      secondWin.add(b2);
       
      b1.addEventListener('click',function(){
      	navWin.push(secondWin)
      });
       
      b2.addEventListener('click',function(){
      	navWin.pop(secondWin)
      });
       
      navWin.open();
      

      Details

      navigationWindow is supposed to be the top-level container (is a Window proxy, not a View).

      Is going to work as alternative Ti.UI.iPhone.NavigationGroup (which is going to be deprecated)

      Should also work if used in Ti.UI.iPad.SplitWindow.

      Notes

      I think the expected behavior is to be able to use it pretty much in this way:

      <Alloy>
      	<NavigationWindow id='navigation'>
      		<Window id='mainWin'>
      			<other stuff...>
      		</Window>
      	</NavigationWindow>
      </Alloy>
      

      Then I guess that windows could be added or removed from the navigationWindow using something like:

      var newWin = Alloy.createController('newWin').getView();
      $.navigation.push(newWin);
      

      and

      $.navigation.pop(newWin);
      

      Additional info

      Attached you can find also an Alloy sample code using the navigationWindow element defined in the index controller instead of in the .xml markup

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tlukasavage Tony Lukasavage
                Reporter:
                fcasali Federico Casali
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration