Skip to content

Instantly share code, notes, and snippets.

@addieljuarez
Created October 14, 2013 19:56
Show Gist options
  • Select an option

  • Save addieljuarez/6981220 to your computer and use it in GitHub Desktop.

Select an option

Save addieljuarez/6981220 to your computer and use it in GitHub Desktop.
TextField Animation
var self = Titanium.UI.createWindow({
backgroundColor:'#fff',
});
var textField = Titanium.UI.createTextField({
top:300,
height:40,
borderColor:'red',
width:200,
});
var up = Titanium.UI.createAnimation({
top:-150,
bottom:150,
});
var down = Titanium.UI.createAnimation({
top:0,
bottom:0,
});
textField.addEventListener('focus', function(e){
// self.top = -150;
// self.bottom = 150;
self.animate(up);
Titanium.API.info('test');
});
textField.addEventListener('blur',function(e){
// self.top = 0;
// self.bottom = 0;
self.animate(down);
Titanium.API.info('test2');
});
self.add(textField);
self.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment