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
| /* Kosso : March 12th 2011 | |
| This the only way I managed to do this without the app crashing on resume. | |
| Done slightly differently to the KS example, since they unregister the service and | |
| do not use a setInterval timer. | |
| */ | |
| //############ in app.js : | |
| // test for iOS 4+ |
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.currentWindow; | |
| win.title='win6'; | |
| var oldWindow = win.oldWindow; | |
| oldWindow.push(win); | |
| var button1 = Ti.UI.createButton({ | |
| title:'go to root without animation', | |
| height:50, | |
| width:250, |
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 Mobile code for slider control functionality | |
| //---------------------------------------- | |
| // @CJ_Reed 23rd Dec 2010 | |
| var sliderView = Titanium.UI.createView({top:100,height:50,left: 40,width:240,backgroundColor:'#000'}); | |
| var sliderButton = Titanium.UI.createView({width:96,borderRadius:5,backgroundColor:'#bbb',height:sliderView.height,left:sliderView.left,top:sliderView.top}); | |
| Titanium.UI.currentWindow.add(sliderView); | |
| Titanium.UI.currentWindow.add(sliderButton); | |
| function unlock (){ |
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 = Titanium.UI.createWindow({ | |
| title:'table', | |
| }); | |
| var table = Ti.UI.createTableView({}); | |
| win.add(table); | |
| var oldRow = {}; | |
| function swipe(a,b,c){ | |
| // a = view |
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 Utils = { | |
| RemoteImage: function(a){ | |
| a = a || {}; | |
| var md5; | |
| var needsToSave = false; | |
| var savedFile; | |
| if(a.image){ | |
| md5 = Ti.Utils.md5HexDigest(a.image)+'.jpg'; | |
| savedFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,md5); | |
| if(savedFile.exists()){ |
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({ | |
| title:'Row #50' | |
| }); | |
| var buttonBar = Ti.UI.createButtonBar({ | |
| labels:['top','middle','bottom'] | |
| }); | |
| win.rightNavButton = buttonBar; |
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
| // Create a new project and copy this code into app.js | |
| // if you use this code, please give me credit :) | |
| function JustAView(text){ | |
| var view = Ti.UI.createView({ | |
| backgroundColor:"#"+((1<<24)*Math.random()|0).toString(16), | |
| width:200, | |
| height:100 | |
| }); | |
| var label = Ti.UI.createLabel({ |