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
| var newtop = Ti.Platform.displayCaps.platformHeight + 20; | |
| function doBox(e) { | |
| $.box.animate({ | |
| top:newtop, | |
| duration:2000, | |
| autoreverse: true | |
| }); | |
| } | |
| $.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
| var vidWin = Titanium.UI.createWindow({ | |
| title : 'Video', | |
| backgroundColor : '#fff' | |
| }); | |
| var videoPlayer = Titanium.Media.createVideoPlayer({ | |
| top : 2, | |
| autoplay : true, | |
| backgroundColor : 'blue', | |
| height : 300, |
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
| //How to GET and POST special characters to server | |
| var win=Titanium.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var lbl = Titanium.UI.createLabel({ | |
| top:10, | |
| width:300, | |
| left:10, |
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
| Titanium.Geolocation.getCurrentPosition(function(e) | |
| { | |
| if (!e.success || e.error) | |
| { | |
| currentLocation.text = 'error: ' + JSON.stringify(e.error); | |
| Ti.API.info("Code translation: "+translateErrorCode(e.code)); | |
| alert('error ' + JSON.stringify(e.error)); | |
| return; | |
| } | |
| var longitude = e.coords.longitude; |
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
| var win = Ti.UI.createWindow({backgroundColor : 'white'}); | |
| var txtFld = Ti.UI.createTextField({ | |
| height : 40, | |
| width : 120, | |
| backgroundColor : 'gray' | |
| }); | |
| win.add(txtFld); | |
| var numLbl = Ti.UI.createLabel({ |
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
| var win = Ti.UI.createWindow({ | |
| backgroundColor : '#000', | |
| layout:'vertical' | |
| }); | |
| var mp3_array = []; | |
| mp3_array.push('music/sound1.mp3'); | |
| mp3_array.push('music/sound2.mp3'); | |
| mp3_array.push('music/sound3.mp3'); |
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
| var win = Ti.UI.createWindow({ | |
| fullscreen: true, | |
| backgroundColor: 'blue', | |
| }); | |
| setInterval(function(){ | |
| var backColor = win.backgroundColor; | |
| if(backColor == 'blue'){ | |
| win.animate({backgroundColor: 'purple', duration: 1500}); | |
| win.backgroundColor = 'purple'; |
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
| var win = Ti.UI.createWindow(); | |
| var loaderImage = Ti.UI.createImageView({ | |
| width:150, | |
| height:150 | |
| }); | |
| // set the length of the images you have in your sequence | |
| var loaderArrayLength=3; | |
| // initialize the index to 1 |
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
| var PDF = require('bencoding.pdf'); | |
| var converters = PDF.createConverters(); | |
| var win = Ti.UI.createWindow({ backgroundColor:'#fff'}); | |
| var vwContent = Ti.UI.createView({ | |
| top:0, layout:'vertical' | |
| }); | |
| win.add(vwContent); | |
| vwContent.add(Ti.UI.createView({ |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| print("Object Oriented Programming") | |
| // Protocal | |
| protocol PurchaseItem { | |
| func cost() -> Float |