Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

TextField focus event and resizing a TableView

I have a Table View that has TextFields in some of the rows. When I focus on a TextField the keyboard pops up as expected. What I want to do is when the keyboard is visible to change the tableView height to reflect the amount of space left after the keyboard. This will allow users to fully scroll the tableView with the Keyboard showing.

I've tried adding an event to the focus event of the textfield and although the tableview does change size it also loses focus on the textbox:

textbox.addEventListener('focus', function(e) {
   tableView.height = 200;

Is there a way I can rezize the tableView and maintain focus on the textbox?

If the keyboard goes away I want to add a event to put the tableView back to the full size.

— asked October 7th 2010 by Roger Chapman
1 Comment
  • I have the same problem. I tried animating the tableview to the new height as well as adding a delay before I set the tableview height, but the textbox still loses focus.

    — commented October 8th 2010 by Carmen Wick

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.