Created
February 21, 2014 01:27
-
-
Save arturoleon/9127094 to your computer and use it in GitHub Desktop.
Alloy ejercicio Clase 1
This file contains 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
// The contents of this file will be executed before any of | |
// your view controllers are ever executed, including the index. | |
// You have access to all functionality on the `Alloy` namespace. | |
// | |
// This is a great place to do any initialization for your app | |
// or create any global variables/functions that you'd like to | |
// make available throughout your app. You can easily make things | |
// accessible globally by attaching them to the `Alloy.Globals` | |
// object. For example: | |
// | |
// Alloy.Globals.someGlobalFunction = function(){}; | |
Alloy.Globals.alerta = function(msg){ | |
alert(msg); | |
}; |
This file contains 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
function clickImage(e) { | |
Titanium.UI.createAlertDialog({title:'Image View', message:'You clicked me!'}).show(); | |
var secudaria = Alloy.createController('secundaria').getView(); | |
secudaria.open(); | |
} | |
$.index.open(); |
This file contains 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:"white" | |
}, | |
"#l":{ | |
bottom:20, | |
width: Ti.UI.SIZE, | |
height: Ti.UI.SIZE, | |
color:'#999' | |
}, | |
"#imageView":{ | |
image:"/images/apple_logo.jpg", | |
width:24, | |
height:24, | |
top:100 | |
} |
This file contains 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> | |
<ImageView id="imageView" onClick="clickImage"/> | |
<Label id="l">Click Image of Apple Logo</Label> | |
</Window> | |
</Alloy> |
This file contains 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
function cerrarVentana(){ | |
Alloy.Globals.alerta("Mensaje!"); | |
$.secundaria.close(); | |
} |
This file contains 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:"white" | |
}, | |
"#l":{ | |
bottom:20, | |
width: Ti.UI.SIZE, | |
height: Ti.UI.SIZE, | |
color:'#000' | |
} |
This file contains 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> | |
<Label id="l" onClick="cerrarVentana">Cerrar ventana secundaria</Label> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment