Titanium Community Questions & Answer Archive

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

TableView Displacement Bug.

I encountered this behavior while placing a textfield in the last row of my tableview. Once you focus on the textfield or area the keyboard comes up as expected. I placed a blur() on a button in the keyboard toolbar. So when you click/tap it hides the keyboard. The Tableview slides up so it is always visible when typing.

The problem occurs on blur that the keyboard slides down, it seems the extra spaced padded into the tableview that pushed the row up persist.

I checked this in kitchenSink on the Iphone and it has the same behavior. Just go o the tableView demo with text fields and enter text in the last row and hit the retunr key.

The space is added at the bottom and I haven't found a way to remove it.

Anyone have an idea or workaround?

— asked September 5th 2010 by Juan Bermudez
  • iphone
  • tableview
  • textarea
  • textfield
  • Same problem here. Can't figure this out!

    — commented March 4th 2012 by Nidhi Shah
  • Anybody managed to solve it?

    — commented December 3rd 2012 by Ygor Lemos

6 Answers

  • I've run into this same problem. Did you ever find a solution?

    — answered October 11th 2010 by Mike Dosey
  • This is a problem for me too! When the keyboard shows, the tableview is being scrolled upwards for like 5 pixels. When the keyboard is blurred, the tableview is stuck in that position. I've tried with scrollable:false and moving:false but nothing works! =(

    — answered September 16th 2011 by Nils D
  • hm same problem here. Everything worked fine under iOS 4.3 but with iOS 5 thats a big problem.

    — answered October 17th 2011 by Achim Hoth
  • I found the solution. try to put everything in a view and put layout= scroll
    like this:

    var view = Ti.UI.createView({

    and then add your tableview in "view".

    — answered March 7th 2012 by Nidhi Shah
    1 Comment
    • Nidhi,

      I'm still having this issue. I tried your suggestion, but it didn't exactly work. Views don't have a contentWidth or contentHeight and layout doesn't have a 'scroll' option. Can you explain a bit more what exactly you did here?

      — commented March 10th 2012 by Jose Padilla
  • I had a similar issue on a webview. I'd have a text box inside of a div that was fixed on the page. When i clicked inside the text box, hide the keyboard, and then tried to click in the input again, it would be offset a bit. I resolved this by setting a height to my body of my webview. This might not relate to the tableview but i figured it might help someone.

    So for example. i have a landscape app so i set my height of the html body to 750px and it resolved it. Since the container is not bigger than the screen, it will retain back to the normal position.

    You should be able to then allow overflow scroll of the div.

    — answered July 23rd 2012 by adrian sanchez
  • Anybody managed to solve it?

    — answered December 3rd 2012 by Ygor Lemos
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.