// 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
//
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
tabBarHidden:true
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var input_1 = Titanium.UI.createTextField({
color:'#787878',
height:45,
top:20,
width:250,
hintText:'test hint',
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
});
win1.add(input_1);
var button1 = Titanium.UI.createButton( {
title : "Go",
top: 150,
width: 200,
height: 44
});
win1.add(button1);
button1.addEventListener('click', function (e){
alert('Hello \n You have logged in with a username of '+input_1.value+'.');
});
//
// add tabs
//
tabGroup.addTab(tab1);
// open tab group
tabGroup.open();
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',
backgroundColor:'#fff',
tabBarHidden:true
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var input_1 = Titanium.UI.createTextField({
color:'#787878',
height:45,
top:20,
width:250,
hintText:'test hint',
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
});
win1.add(input_1);
var button1 = Titanium.UI.createButton( {
title : "Go",
top: 150,
width: 200,
height: 44
});
win1.add(button1);
button1.addEventListener('click', function (e){
alert('Hello \n You have logged in with a username of '+input_1.value+'.');
});
//
// add tabs
//
tabGroup.addTab(tab1);
// open tab group
tabGroup.open();
No comments:
Post a Comment