How to manage view by shifting up and down while keyboard hides the textfield in Titanium?


Here emailIdText,passwordtext,ConfirmPasswordText are hidden by the keyboard while typing. So, by the following code we can shift the view (eg: here i am using centerView).

emailIdText.addEventListener(‘focus’,function(){
    centerView.top=85; // appropiate height that is not hidden by keyboard. Please edit as your code.
  
});
emailIdText.addEventListener(‘return’,function(){
    centerView.top=125; // appropiate height that is not hidden by keyboard. Please edit as your code.
 
});
passwordText.addEventListener(‘focus’,function(){
    centerView.top=45; // appropiate height that is not hidden by keyboard. Please edit as your code.
});
passwordText.addEventListener(‘return’,function(){
    centerView.top=125; // appropiate height that is not hidden by keyboard. Please edit as your code.
    
});
confirmPasswordText.addEventListener(‘focus’,function(){
    centerView.top=5; // appropiate height that is not hidden by keyboard. Please edit as your code.
});
confirmPasswordText.addEventListener(‘return’,function(){
    centerView.top=125; // appropiate height that is not hidden by keyboard. Please edit as your code.
    
});

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s