Created
June 27, 2010 06:47
-
-
Save anonymous/454713 to your computer and use it in GitHub Desktop.
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 = Titanium.UI.currentWindow; | |
win.barColor = '#13386c'; | |
win.backgroundColor = '#13386c'; | |
var data = []; | |
var row = Ti.UI.createTableViewRow({height:'auto',backgroundColor:'#ffffff',selectedBackgroundColor:'#dddddd'}); | |
var userName = Ti.UI.createLabel({ | |
text: 'User Name', | |
color: '#000000', | |
textAlign:'left', | |
// Depending on your field name length and field values, you'll want to adjust the left and width values. | |
left:10, | |
height:40, | |
font:{fontWeight:'bold',fontSize:16} | |
}); | |
row.add(userName); | |
var userNameValue = Titanium.UI.createTextField({ | |
hintText:'Required', | |
color: '#666666', | |
textAlign:'left', | |
left:110, | |
width:190, | |
font:{fontWeight:'plain',fontSize:14}, | |
autocorrect:false, | |
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_NONE, | |
keyboardType: Titanium.UI.KEYBOARD_DEFAULT, | |
returnKeyType: Titanium.UI.RETURNKEY_NEXT, | |
autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, | |
enableReturnKey: true | |
}); | |
row.add(userNameValue); | |
data[0] = row; | |
var row = Ti.UI.createTableViewRow({height:'auto',backgroundColor:'#ffffff',selectedBackgroundColor:'#dddddd'}); | |
var Password = Ti.UI.createLabel({ | |
text: 'Password', | |
color: '#000000', | |
textAlign:'left', | |
left:10, | |
height:40, | |
font:{fontWeight:'bold',fontSize:16} | |
}); | |
row.add(Password); | |
var passwordValue = Titanium.UI.createTextField({ | |
hintText:'Required', | |
color: '#666666', | |
textAlign:'left', | |
left:110, | |
width:190, | |
font:{fontWeight:'plain',fontSize:14}, | |
autocorrect:false, | |
passwordMask:true, | |
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_NONE, | |
keyboardType: Titanium.UI.KEYBOARD_ASCII, | |
returnKeyType: Titanium.UI.RETURNKEY_GO, | |
autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, | |
enableReturnKey: true | |
}); | |
row.add(passwordValue); | |
data[1] = row; | |
// create table view | |
var tableview = Titanium.UI.createTableView({ | |
data:data, | |
// allowsSelection is a nice thing to have if you're just displaying data. | |
allowsSelection:false, | |
backgroundColor: '#13386c', | |
top: 90, | |
style:Titanium.UI.iPhone.TableViewStyle.GROUPED | |
}); | |
// add table view to the window | |
Titanium.UI.currentWindow.add(tableview); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment