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
| Titanium.UI.setBackgroundColor('#000'); | |
| var windows = []; | |
| // | |
| // create base UI tab and root window | |
| // | |
| var win1 = Titanium.UI.createWindow({ | |
| title : 'Tab 1', | |
| backgroundColor : '#fff', | |
| exitOnClose : 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
| // Must have a pdf reader app installed, maybe Adobe Reader, maybe something else | |
| var win = Ti.UI.createWindow({ | |
| navBarHidden: true, | |
| backgroundColor: 'blue' | |
| }); | |
| win.open(); | |
| var button = Ti.UI.createButton({ | |
| title: 'Get PDF', | |
| height: 50, |
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 data = []; | |
| for (var i = 0; i < 10; i++) { | |
| data.push({title:'I am row text '+i }); | |
| } | |
| var tableView = Ti.UI.createTableView({ | |
| data:data | |
| }); | |
| tableView.setCreateCallback(function(e) { |
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
| // Must use TiSDK 1.8.0.v20110915133349 or newer | |
| var tabGroup = Ti.UI.createTabGroup(); | |
| var win1 = Ti.UI.createWindow({ | |
| backgroundColor : 'white', | |
| orientationModes : [Ti.UI.PORTRAIT] | |
| }); | |
| var label1 = Ti.UI.createLabel({ | |
| text : 'I am a label' | |
| }); | |
| win1.add(label1); |
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 : 'black', | |
| orientationModes : [Ti.UI.PORTRAIT] | |
| }); | |
| win.open(); | |
| var activeVideo = Titanium.Media.createVideoPlayer({ | |
| top : 0, | |
| height : 200 | |
| }); | |
| win.add(activeVideo); |
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
| // by Blain Hamon | |
| var win = Ti.UI.createWindow({ | |
| backgroundColor : 'white', | |
| orientationModes : [Ti.UI.PORTRAIT] | |
| }); | |
| win.open(); | |
| var label = Ti.UI.createLabel({ | |
| text : 'No app event received. Make call while running app', | |
| textAlign : 'center', |
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(); | |
| win.addEventListener('click', function(e) { | |
| var intent = Ti.Android.createIntent({ | |
| action : Ti.Android.ACTION_VIEW, | |
| data : "https://www.google.com/" |
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(); | |
| var button = Ti.UI.createButton({ | |
| title : "Click me!", | |
| height : 50, | |
| width : 200, | |
| top : 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
| var win1 = Titanium.UI.createWindow({ | |
| title : 'Tab 1', | |
| backgroundColor : '#fff', | |
| fullscreen: true, | |
| }); | |
| // orientationModes needs to be set after the createWindow | |
| win1.orientationModes = [Ti.UI.PORTRAIT]; | |
| var b1 = Titanium.UI.createButton({ | |
| title : 'Win 2', |
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
| // GLOBAL SCOPE | |
| var win = Ti.UI.createWindow(); | |
| var parentView = Ti.UI.createView(); | |
| var childView = Ti.UI.createView(); | |
| parentView.add(childView); | |
| win.add(parentView); | |
| win.open(); | |