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: 'red' }); | |
var md5 = Ti.Utils.md5HexDigest(win.toImage()); | |
var label = Ti.UI.createLabel({ | |
text:md5 | |
}); | |
win.add(label); | |
win.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 newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'mydir'); | |
Ti.API.info("Created mydir: " + newDir.createDirectory()); | |
Ti.API.info('newdir ' + newDir); | |
var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'backup.txt'); | |
if(newFile.exists()){ | |
newFile.write("I should be backed up!"); | |
newFile.remoteBackup = true; | |
//or we can set the whole folder to be iCloudable | |
//newDir.remoteBackup = true; | |
} |
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: 'black' } | |
); | |
var center1 = {'x': 100, 'y':100}; | |
var center2 = {'x': 100, 'y':250}; | |
var lastIndex = 1; | |
var background = Ti.UI.createView({ backgroundColor:"#444444", }); | |
var view = Ti.UI.createView({ backgroundColor:'red', center:center1, width:100, height:100, zIndex:lastIndex++, }); | |
var view2 = Ti.UI.createView({ backgroundColor:'green', center:center2, width:100, height:100, zIndex:lastIndex, }); | |
background.addEventListener('touchstart', function(e){ |
NewerOlder