How do I center a text field in Titanium? Here's the text field code:
var textfield1 = Titanium.UI.createTextField({
color:'#006',
backgroundColor:'#fff',
height:50,
top:'auto',
left:'auto',
width:300,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
If your parent uses a vertical layout, it's auto centered. 'auto' top will be 0 ; remove your left. You can also use textAlign : 'center' in other layouts.