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
| // Please note that this is a dirty solution. | |
| // It does work, but Appcelerator does not support it (adding things to the Ti namespace). | |
| // There is a very good chance that it will not be possible in future releases. | |
| Ti.include('ui.js'); | |
| var win = Ti.App.ui.createCustomWindow(); | |
| var button = Ti.App.ui.createCustomButton(); | |
| 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 tableView = Ti.UI.createTableView(); | |
| var setupDB = function() { | |
| var db = Ti.Database.open('mydb.db'); | |
| db.execute('CREATE TABLE IF NOT EXISTS DATABASETEST (ID INTEGER, NAME TEXT)'); | |
| db.execute('DELETE FROM DATABASETEST'); |
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: 'yellow' | |
| }); | |
| var imageView = Titanium.UI.createImageView(); | |
| win.add(imageView); | |
| imageView.image = 'http://localhost/~jalter/GitApp/images/test.jpg?time='+new Date().getTime(); | |
| var button = Ti.UI.createButton({ | |
| title: 'click', |
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(); | |
| Titanium.Facebook.appid = '187692147928682'; | |
| Titanium.Facebook.permissions = ['publish_stream']; | |
| Titanium.Facebook.addEventListener('logout', function(e) { | |
| alert('Logged out'); | |
| button.title = "Login"; | |
| }); | |
| Ti.Facebook.addEventListener('login', function(e) { | |
| Ti.API.info("Logged in now!"); |
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 win1 = Titanium.UI.createWindow({ | |
| title:'Tab 1', | |
| backgroundColor:'#fff' | |
| }); | |
| var camera_button = Titanium.UI.createButton ({ | |
| title:'Camera', | |
| height:60, |
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'); | |
| // create tab group | |
| var tabGroup = Titanium.UI.createTabGroup(); | |
| // | |
| // create base UI tab and root window | |
| // | |
| var win1 = Titanium.UI.createWindow({ | |
| title:'Tab 1', |
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
| // Please note that this is a dirty solution. | |
| // It does work, but Appcelerator does not support it (adding things to the Ti namespace). | |
| // There is a very good chance that it will not be possible in future releases. | |
| var ui = {}; | |
| var labels = {}; | |
| Ti.include('ui.js'); | |
| Ti.include('labels.js'); |
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 tabGroup = Ti.UI.createTabGroup(); | |
| var win1 = Ti.UI.createWindow({ | |
| title: 'Win 1', | |
| url: 'win1.js' | |
| }); | |
| var tab1 = Ti.UI.createTab({ | |
| title: 'Tab 1', | |
| window: win1 |
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: true }); | |
| var cameraOverlay = Ti.UI.createView(); | |
| var cameraButton = Ti.UI.createButton({ | |
| title:"Take Picture", | |
| bottom: 10 | |
| }); | |
| cameraButton.addEventListener('click', function(e){ | |
| Ti.Media.takePicture(); | |
| }); |
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 tabGroup = Titanium.UI.createTabGroup(); | |
| var win1 = Titanium.UI.createWindow({ | |
| title:'Tab 1', | |
| url:'main.js' | |
| }); | |
| var tab1 = Titanium.UI.createTab({ | |
| icon:'KS_nav_views.png', |