Created
April 8, 2015 10:00
-
-
Save himalay/23a94be3dc6838093d51 to your computer and use it in GitHub Desktop.
So here is a really simple example that will get you started. To try this create a new default Alloy app and then use the bold filenames to create a new file and then copy the code in, add new files as required. Important; removed the contents of the index.tss but leave the file - just in case anything conflicts, will not kill anything, just may…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Window": { | |
| backgroundColor: '#fff' | |
| }, | |
| "Label": { | |
| color: '#000', | |
| font: { | |
| fontWeight: 'bold' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (OS_IOS || OS_MOBILEWEB) { | |
| // attach the navgroup to Alloy.CFG so it can be accessed globally | |
| Alloy.CFG.navgroup = $.navgroup; | |
| // We can do most of this in markup once we resolve: | |
| // https://jira.appcelerator.org/browse/ALOY-202 | |
| // | |
| // TODO: find out why nav buttons and titles don't work for mobileweb | |
| var button = Ti.UI.createButton({ title: 'next' }); | |
| button.addEventListener('click', function(e) { | |
| $.navgroup.open(Alloy.createController('win2').getView()); | |
| }); | |
| $.win1.rightNavButton = button; | |
| } | |
| $.index.open(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Alloy> | |
| <Window id="index"> | |
| <NavigationGroup id="navgroup" platform="ios,mobileweb"> | |
| <Window title="Window 1" id="win1"> | |
| <Label>This is the first window</Label> | |
| </Window> | |
| </NavigationGroup> | |
| <Label platform="android">NavigationGroup not available on Android</Label> | |
| </Window> | |
| </Alloy> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // We can do most of this in markup once we resolve: | |
| // https://jira.appcelerator.org/browse/ALOY-202 | |
| var button = Ti.UI.createButton({ title: 'next' }); | |
| button.addEventListener('click', function(e) { | |
| // Access navgroup from Alloy.CFG, set in index.js | |
| Alloy.CFG.navgroup.open(Alloy.createController('win3').getView()); | |
| }); | |
| $.win2.rightNavButton = button; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Alloy> | |
| <Window title="Window 2"> | |
| <Label>This is window 2</Label> | |
| </Window> | |
| </Alloy> | |
| app/views/win3.xml | |
| <Alloy> | |
| <Window title="Window 3"> | |
| <Label>This is window 3</Label> | |
| </Window> | |
| </Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment