most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
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++) { |
//Credits to Vali Filip | |
var win=Titanium.UI.currentWindow; | |
Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
var origin1 = Titanium.UI.createSearchBar({ | |
barColor:'#000', | |
showCancel:true, | |
height:40, | |
top:0, |
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)}); | |
} |
<Alloy> | |
<Window> | |
<!-- all platforms --> | |
<View/> | |
<!-- only on ios will this element, and all its subviews, appear --> | |
<View platform="ios"> | |
<View/> | |
</View> |
function doClickMenu(evt){ | |
alert(evt.source.title); | |
} | |
// we need to do some things to the Window once it is properly instanciated, so we add an event listener to its OPEN event | |
$.win.addEventListener('open',function(){ | |
var actionBar = $.win.activity.actionBar; // get a handle to the action bar | |
actionBar.title='My App'; // change the App Title | |
actionBar.displayHomeAsUp=true; // Show the "angle" pointing back | |
actionBar.onHomeIconItemSelected = function() { // what to do when the "home" icon is pressed |
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.
[sudo] npm install -g supervisor