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
//This should be pasted as app.js into a new Titanium Project, | |
//with MobileSDK 1.8RC1, using V8 as the JS engine. | |
var window = Ti.UI.createWindow({ | |
id:"w" | |
}); | |
var b=Ti.UI.createButton({ | |
id:"b1" | |
}); |
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 str = "<test name='appcelerator'/>" | |
var xml = Ti.XML.parseString(str); | |
var node = xml.documentElement; | |
//Ti.API.info("Attributes: "+xml.attributes); | |
if (node.attributes && (node.attributes.length > 0)) { | |
Ti.API.info(" Value: "+node.attributes.item(0).nodeValue); | |
}; | |
win = Ti.UI.createWindow(); | |
win.open(); |
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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Titanium.UI.setBackgroundColor('#000'); | |
// create tab group | |
var tabGroup = Titanium.UI.createTabGroup(); | |
Ti.API.info("Version: "+Ti.App.version); | |
// | |
// create base UI tab and root window |
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
tt.ui.createStackView = function(_args) { | |
var stack = Ti.UI.createView(tt.combine($$.stretch,_args.props||{})); | |
stack.currentIndex = _args.currentIndex||0; | |
//populate stack | |
for (var i = 0; i < _args.views.length; i++) { | |
var w = _args.views[i]; | |
if (i == stack.currentIndex) { | |
w.visible = true; |
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 win1 = Titanium.UI.createWindow({ | |
title:'Test', | |
backgroundColor:'#000' | |
}); | |
var myview = Ti.UI.createView(); | |
var actInd = Titanium.UI.createActivityIndicator({ | |
height:50, | |
width:10 |
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
/* Example of padding in labels - | |
* Mauro Parra-Miranda mauropm@gmail.com | |
*/ | |
var vLabel = Ti.UI.createView({ | |
width: 300, | |
height: 35, | |
top: 120 | |
}); |
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 textWindow = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
borderColor: 'black', | |
borderWidth: 1, | |
width: '100%', | |
height: '100%', | |
navBarHidden: true | |
}); | |
var scrollView = Ti.UI.createScrollView({ | |
layout: 'vertical', |
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
/** | |
* Override a tab group's tab bar on iOS. | |
* | |
* NOTE: Call this function on a tabGroup AFTER you have added all of your tabs to it! We'll look at the tabs that exist | |
* to generate the overriding tab bar view. If your tabs change, call this function again and we'll update the display. | |
* | |
* @param tabGroup The tab group to override | |
* @param backgroundOptions The options for the background view; use properties like backgroundColor, or backgroundImage. | |
* @param selectedOptions The options for a selected tab button. | |
* @param deselectedOptions The options for a deselected tab button. |
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 sv = Ti.UI.createScrollView({ | |
contentWidth:'auto', | |
contentHeight:'auto', | |
top:0, | |
showVerticalScrollIndicator:true, | |
showHorizontalScrollIndicator:true | |
}); | |
win.add(sv); |
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({ | |
title:'testing labels', | |
}); | |
var row=Ti.UI.createTableViewRow({ | |
layout:'vertical', | |
height:'auto' | |
}); | |
var firstLabel= Ti.UI.createLabel({ | |
top:10, |
OlderNewer