Skip to content

Instantly share code, notes, and snippets.

@ricardoalcocer
Created November 22, 2012 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardoalcocer/4133046 to your computer and use it in GitHub Desktop.
Save ricardoalcocer/4133046 to your computer and use it in GitHub Desktop.
Basic Alloy : Opening Windows
function showWin1(e) {
var w=Alloy.createController('win2').getView();
w.open();
}
$.index.open();
".container": {
backgroundColor:"white"
},
"#Label": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000"
}
<Alloy>
<Window class="container">
<Label id="label" onClick="showWin1">I'm Window 1</Label>
</Window>
</Alloy>
function closeme(){
$.container.close();
}
"#container":{
backgroundColor: "#000"
},
"#thelabel":{
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
color: "#fff"
}
<Alloy>
<Window id="container">
<Label id="thelabel" onClick="closeme">I'm Window 2</Label>
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment