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
// create our web view | |
var win = Ti.UI.createWindow({ backgroundColor: "#fff" }); | |
var web = Ti.UI.createWebView({ url: "http://chicago.craigslist.org/" }); | |
// inject our css when the web view finishes loading (because we need to inject into the head element) | |
web.addEventListener('load', function () { | |
// first, specify the CSS file that we should load | |
var cssFileName = 'styles.css'; | |
// read in the contents | |
var cssFromFile = Ti.Filesystem.getFile(cssFileName); |
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' }); | |
var rotate = Ti.UI.create2DMatrix().rotate(90); | |
var counterRotate = rotate.rotate(-180); | |
var scrollView = Titanium.UI.createScrollableView({ | |
views:[ | |
Titanium.UI.createImageView({ image:'default_app_logo.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_ui.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_views.png', transform: counterRotate }) |
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
/* 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 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 TiDrop = { | |
touching: false, | |
position: { | |
elementYStart: 0, | |
elementXStart: 0, | |
yStart: 0, | |
xStart: 0, | |
yCurrent: 0, | |
xCurrent: 0 | |
}, |
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 TiLoad = { | |
visible: false, | |
init: function(_properties) { | |
var options; | |
if(_properties && _properties.rotate) { | |
options = { | |
orientationModes: [ | |
Titanium.UI.LANDSCAPE_LEFT, | |
Titanium.UI.LANDSCAPE_RIGHT, |
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
/* Ever wondered how to get the nice column of letters in the right side | |
* of the table view? | |
* | |
* Here is an example: | |
* 1. We take a list of names from a json file | |
* 2. We need to sort them by either first name or last name | |
* 3. We need to create a row header once in a while, when the first letter changes | |
* 4. We need to create a table index | |
* | |
*/ |
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 container = Ti.UI.createView({backgroundColor: "white", layout: "vertical"}); | |
var layout = [ | |
{ | |
title: "Parent 1", | |
isparent: true, | |
opened: false, | |
sub: [ | |
{ |
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
/* The images for this example can be downloaded from http://j.mp/loadingimagesforti */ | |
var win = Ti.UI.createWindow({ backgroundColor: '#f00'}); | |
var loading = Ti.UI.createImageView({ | |
images: [ | |
'images/loading/00.png', 'images/loading/01.png', 'images/loading/02.png', | |
'images/loading/03.png', 'images/loading/04.png', 'images/loading/05.png', | |
'images/loading/06.png', 'images/loading/08.png', 'images/loading/09.png', | |
'images/loading/10.png', 'images/loading/11.png' | |
], | |
width: 33, height: 33 |
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
Ti.UI.setBackgroundColor('#000'); | |
var win = Titanium.UI.createWindow({ | |
title : 'test' | |
}); | |
var arrayLength = 5 | |
var fields = new Array(arrayLength); | |
for( i = 0; i < arrayLength; i++) { |
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 PassCode(_params){ | |
_params = _params || {}; | |
// @PARAMS:{ | |
// boxSize: (Number) size of the passcode character boxes | |
// backgroundColor: (String) background color of the mainview | |
// backgroundImage: (String) background image of the mainview | |
// panicColor: (String) background color of the view when panic() is called - when wrong password | |
// titleText: (String) the text of the title view, above the pass code boxes by default, | |
// mainView: (Object) params for the main view that hold the passcode boxes |
OlderNewer