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 isDir(path) { | |
var file = Ti.Filesystem.getFile(path); | |
if ( !file.exists() ) { | |
return false; | |
} | |
var nativePath = file.nativePath; | |
Ti.API.info(nativePath); | |
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
var rootWindow = Titanium.UI.createWindow({backgroundColor : "white", title : "Login"}); | |
var loginBtn = Ti.UI.createButton({title: 'Login', width: 100, height: 40}); | |
rootWindow.add(loginBtn); | |
var nav = Titanium.UI.iPhone.createNavigationGroup({ | |
window : rootWindow | |
}); | |
var win = Titanium.UI.createWindow(); |
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
var win = Ti.UI.createWindow(); | |
var data = []; | |
for(var i = 0; i < 5; i++) { | |
data.push({title : 'Title ' + i, id : i.toString(), addr : 'Addr ' + i}); | |
} | |
var table = Ti.UI.createTableView({ | |
data : data, | |
_data : data |
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
http://developer.appcelerator.com/question/135291/is-it-possible-to-host-a-server-on-a-titanium-mobile-app |
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
var win = Titanium.UI.createWindow({backgroundColor: 'white'}); | |
var img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='; | |
var index = img.indexOf('base64,'); | |
img = img.substring(index + 'base64,'.length); | |
Ti.API.info(img); | |
var imageView = Ti.UI.createImageView({ | |
image: Ti.Utils.base64decode(img), | |
width: 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
var rows = []; | |
for( var i = 0; i < 30; i++ ) { | |
var row = Ti.UI.createTableViewRow({ | |
title: 'Row ' + i, | |
recordID: i | |
}); | |
rows.push(row); | |
} |
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
var win = Ti.UI.createWindow({ | |
backgroundColor:'#fff' | |
}); | |
// create table view data object | |
var data = [ | |
{title:'Alan', hasChild:true, header:'A'}, | |
{title:'Alice', hasDetail:true}, | |
{title:'Alexander'}, | |
{title:'Amos'}, |
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
http://codertap.com/post/20253623391/handling-webview-events-natively-in-titanium?b67edb70?8d2f6a38 |
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
var win = Ti.UI.createWindow(); | |
win.open(); | |
/// <<< Register & UnRegister Event Listeners | |
/** | |
* params: {event: 'event', callback: eventCallback} | |
*/ | |
function registerEventListener(obj, params) { | |
if ( typeof obj._eventListeners == 'undefined' ) { |
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
var win = Ti.UI.createWindow({backgroundColor: 'white'}); | |
var searchbar = Ti.UI.createSearchBar({ top: 0, height: 43, showCancel: false }); | |
win.add(searchbar); | |
// Function to dump data | |
function dumpData() { | |
var data = []; | |
for(var i = 0; i < 20; i ++) { | |
data.push({title: Math.random().toString(36).substring(5)}); | |
} |
NewerOlder