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 colors = ['red', 'green', 'blue', 'pink', 'brown']; | |
var data = []; | |
var win = Ti.UI.createWindow({ | |
backgroundColor: 'white' | |
}); | |
win.open(); | |
function createRow(params){ | |
var row = Ti.UI.createTableViewRow({ |
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
App.UI.Image = function(_params) { | |
_params.preventDefaultImage = true; | |
var folder = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, "cache"); | |
if(!folder.exists()){ | |
folder.createDirectory(); | |
} | |
var filename = Ti.Utils.base64encode(_params.image.toString()); |
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'}); | |
win.open(); | |
// build our layout with 2 views and 1 imageView | |
var mainView = Ti.UI.createView({top:10,height:200,width:200,backgroundColor:'blue'}); | |
var view2 = Ti.UI.createView({height:100,width:100,backgroundColor:'green'}); | |
var imageView = Ti.UI.createImageView({image:'http://www.appcelerator.com/wp-content/uploads/2011/01/Appcelerator-IDC-Q1-Mobile-Developer-Report-appclogo.png'}); | |
mainView.add(view2); | |
view2.add(imageView); |
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 Barcode = require('ti.barcode'); | |
Barcode.allowRotation = false; | |
var barLoadWin = null; | |
Barcode.addEventListener('error', function(e) { | |
Ti.API.info('ERROR called with barcode: ' + e); | |
if(barLoadWin){ | |
barLoadWin.close(); | |
} | |
}); |
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
function squareImage(imageView){ | |
function getThumb(){ | |
imageView.removeEventListener('load',getThumb); | |
var blob = imageView.toBlob(); | |
var height = blob.height; | |
var width = blob.width; | |
if(height < width){ | |
var size = height; |
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 : '#fff' | |
}); | |
var rows = []; | |
function createRow(){ | |
var row1 = Ti.UI.createTableViewRow(); | |
var label = Ti.UI.createLabel({ | |
text: 'heyyyyyy', |
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 view = Ti.UI.createView({ | |
top:0, | |
left:0, | |
backgroundImage:'bluebar.png', | |
height:44, | |
width:320 | |
}); |
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({ | |
masterWindow: true, | |
backgroundColor: 'white' | |
}); | |
var view1 = Ti.UI.createView({ | |
top : 20, | |
left : 20, | |
height : 100, | |
width : 100, |
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
// Remove all children from a view | |
// Pedro :) | |
function removeChildren(el){ | |
var children = el.children; | |
while(el.children.length){ | |
var child = children[el.children.length-1]; | |
removeChildren(child); | |
el.remove(child); | |
} |
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
// info.plist from Test 5 | |
// Open your info.plist and look for CFBundleURLSchemes | |
// this is the string that you will use to open that app | |
// You can also copy the info.plist to the root of your app and edit it. | |
// You can even have multiple schemes that you can use to launch it. | |
// Here I can launch the app using either 'test5://' or 'pedro://' | |
// Be SURE to do a clean build | |
<key>CFBundleURLSchemes</key> | |
<array> |