Skip to content

Instantly share code, notes, and snippets.

@grantges
Last active August 29, 2015 14:06
Show Gist options
  • Save grantges/efaf6fa5da6df8d5bb04 to your computer and use it in GitHub Desktop.
Save grantges/efaf6fa5da6df8d5bb04 to your computer and use it in GitHub Desktop.
An example of how to create a SplitWindow for iPad using Appcelerator Mobile SDK (with Alloy MVC Framework)
$.index.addEventListener('visible',function(e){
if (e.view == 'detail'){
e.button.title = "Master";
$.index.detailView.getWindow().leftNavButton = e.button;
} else if (e.view == 'master'){
$.index.detailView.getWindow().leftNavButton = null;
}
});
$.index.open();
<Alloy>
<SplitWindow backgroundColor="white" platform="ios">
<!-- First window is the masterView -->
<NavigationWindow>
<Window>
<ListView>
<ListSection headerTitle="Types">
<ListItem title="Places" cat="place"></ListItem>
<ListItem title="Visible CheckPoints" cat="visible"></ListItem>
<ListItem title="Underground CheckPoints" cat="underground"></ListItem>
<ListItem title="Hazards" cat="hazard"></ListItem>
</ListSection>
</ListView>
</Window>
</NavigationWindow>
<!-- Second window is the detailView -->
<NavigationWindow>
<Window>
<Module id="mapview" module="ti.map" method="createView" />
</Window>
</NavigationWindow>
</SplitWindow>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment