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
Ti.API.info("@ win_test.js"); | |
var win = Ti.UI.createWindow(); | |
win.backgroundColor = "#b5aea5"; | |
win.open(); | |
var button = Ti.UI.createButton({ | |
title: 'new window' | |
}); | |
button.addEventListener('click', function(e) { | |
var subwin = Ti.UI.createWindow({url: 'main.js', navBarHidden: '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 : 'white', | |
layout : "vertical" | |
}); | |
function createRow(i) { | |
var row = Ti.UI.createView({ | |
height: 45, | |
width: Ti.UI.SIZE, | |
top: 0, left: 0, |
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({ | |
height : Ti.UI.FILL, | |
width : Ti.UI.FILL, | |
backgroundColor : '#fff', | |
windowSoftInputMode: (Ti.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : '' | |
}); | |
var tableView = Ti.UI.createTableView({ | |
width : Ti.UI.FILL, | |
height : Ti.UI.FILL, |
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
// An Example app to show usage of the Crittercism APIs | |
// this does not currently contain best practices for | |
// Crittercism in conjunction with Titanium | |
// | |
// Updated 02-13-2013 | |
Ti.API.info("Ti App: importing Crittercism..."); | |
var crittercism = require('com.crittercism.ti'); | |
Ti.API.info("module is => " + crittercism + "\n"); |
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
Stack Trace | |
_________________________________ | |
0 CoreFoundation 0x31d642a3 __exceptionPreprocess + 163 | |
1 libobjc.A.dylib 0x399fe97f objc_exception_throw + 31 | |
2 CoreFoundation 0x31d641c5 -[NSException initWithCoder:] + 1 | |
3 UIKit 0x33bd489f -[UIViewController __supportedInterfaceOrientations] + 475 | |
4 UIKit 0x33bd46a9 -[UIViewController __withSupportedInterfaceOrientation:apply:] + 25 | |
5 UIKit 0x33c19a41 -[UIViewController _updateLastKnownInterfaceOrientationOnPresentionStack:] + 185 | |
6 UIKit 0x33c19aab -[UIViewController _updateLastKnownInterfaceOrientationOnPresentionStack:] + 291 | |
7 UIKit 0x33bdf061 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 985 |
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
/* | |
//Sample 1 | |
var tableView = require('tv_layout2'); | |
tableView().open(); | |
*/ | |
/* | |
//Sample 2 | |
var data = []; |
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
if(!Ti.App.Properties.hasProperty('notificationCount')) { | |
Ti.App.Properties.setInt('notificationCount', 0); | |
} else { | |
Ti.App.Properties.removeProperty('notificationCount'); | |
var activity = Ti.Android.currentActivity; | |
var intent = Ti.Android.createIntent({ | |
action : Ti.Android.ACTION_MAIN, | |
// you can use className or url to launch the app | |
// className and packageName can be found by looking in the build folder |
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({fullscreen:false}); | |
//create some simple UI | |
var textfield = Ti.UI.createTextField({width:300, height:'auto', top:40, left:20, hintText:'enter message'}); | |
var button = Ti.UI.createButton({title:'Send Notification', width:'auto', top:120, left:20, height:'auto'}); | |
var label = Ti.UI.createLabel({width:'auto', top:200, left:20, height:'auto', width:200, text:'Message from intent:'}); | |
var msgLabel = Ti.UI.createLabel({width:'auto', top:240, left:20, height:'auto', width:200, backgroundColor:'lightgrey', text:'---'}); | |
win.add(textfield); | |
win.add(button); |
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' | |
}); | |
var data = []; | |
// populate array with rows | |
for (var i = 0; i < 40; i++) | |
{ | |
var row = createRow(i); |
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 navigator = require ('ui/navigator').createNavigator(), | |
mainWindow = require('ui/mainWindow').mainWindow(); | |
navigator.open( mainWindow ); | |
setTimeout(function(){ | |
navigator.close(mainWindow); | |
//mainWindow = null; | |
//navigator = null; | |
}, 15000); |