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(); | |
// | |
// 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
Titanium.UI.setBackgroundColor('#000'); | |
var BHunter = {}; | |
Ti.include('ui.js'); | |
BHunter.tabGroup = BHunter.ui.createAppTabGroup(); | |
BHunter.tabGroup.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
var win = Titanium.UI.createWindow(); | |
var win1 = Titanium.UI.createWindow({ | |
backgroundColor:"red", | |
title:"Red Window" | |
}); | |
var nav = Titanium.UI.iPhone.createNavigationGroup({ | |
window: win1 | |
}); | |
var button = Ti.UI.createButton({ |
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 mainWin = Ti.UI.createWindow({ | |
backgroundColor: 'blue' | |
}); | |
var win; | |
var showButton = Ti.UI.createButton({ | |
title: 'show', | |
height: 60, | |
width: 200, | |
top: 80 |
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 tabGroupOuter = Ti.UI.createTabGroup(); | |
tabGroupOuter.addTab(Ti.UI.createTab({ | |
title: 'app.js', | |
window: Ti.UI.createWindow({ | |
title: 'app.js', | |
url: 'middle.js', | |
backgroundColor: 'red' | |
}) | |
})); | |
tabGroupOuter.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
var mainWin = Ti.UI.createWindow({ | |
backgroundColor: 'blue', | |
exitOnClose: false, | |
fullscreen: true | |
}); | |
mainWin.addEventListener('android:back', function(e) { | |
Ti.API.info('clicked BACK button'); | |
}); | |
mainWin.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
// Open an existing window | |
window.open(); | |
// Create the alert dialog popup | |
var popup = Ti.UI.createAlertDialog({ | |
title: "Confirm Purchase?", | |
buttonNames: ["Yes", "No"], | |
cancel: 1 | |
}); | |
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 f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'text.txt'); | |
Ti.API.info('file = ' + f); | |
var contents = f.read(); | |
Ti.API.info('exists = ' + f.exists()); | |
Ti.API.info("contents blob object = "+contents); | |
Ti.API.info('contents = ' + contents.text); | |
var newFile = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,'newfile.txt'); | |
Ti.API.info('mode: '+ Ti.Filesystem.MODE_APPEND); | |
newFile.write(f.read()); |
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({ backgroundColor: '#fff' }); | |
var views = []; | |
for (var i = 0; i < 10; i++) { | |
var imgView = Ti.UI.createImageView({ | |
image: 'KS_nav_ui.png', | |
customData: i+1, | |
top: 0, left: 0, | |
width: 100, | |
height: 50 |
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 myApp = {}; | |
Ti.include('ui.js'); | |
myApp.tabGroup = myApp.ui.createAppTabGroup(); | |
myApp.tabGroup.open(); |
OlderNewer