Skip to content

Instantly share code, notes, and snippets.

@grantges
Created July 17, 2012 22:58
Show Gist options
  • Save grantges/3132716 to your computer and use it in GitHub Desktop.
Save grantges/3132716 to your computer and use it in GitHub Desktop.
TextField - Focus on Window Open Event
var win = Ti.UI.createWindow({layout: 'vertical', backgroundColor:'#fff'});
var textField = Ti.UI.createTextField({
height: Ti.UI.SIZE,
width: '90%',
font: {fontSize: 20},
softKeyboardOnFocus: Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
});
win.add(textField);
win.addEventListener('open', function(e){
textField.focus();
});
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment