Titanium Community Questions & Answer Archive

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

Keyboard in the way; Need to hide it - or - be able scroll up to see covered fields


I have a view containing a table with several editable rows. When you click on one of the top rows, it brings up the keyboard but covers the lower rows. I need to be able to either hide the keyboard when the user scrolls up to see those lower rows - or - make it so that they can scroll up and not have the table bounce back down. I've tried setting the 'scrollTop' and creating a 'touchmove' listener with preventDefault but these don't work. I've seen other apps that allow scrolling to the bottom even when the keyboard is present (e.g. the "Mail, Contacts, Calendars" view in "Settings"), so I know it can be done.



— asked November 27th 2010 by Mark Pemburn
  • iphone
  • keyboard
  • scrolling

2 Answers

  • On the textfields focus change the height of the table to window_height-keyboard_height.This way you will be able to scroll to the bottom. On blur set it back as it was before.

    — answered November 27th 2010 by Dan Tamas
  • Thanks Tamas – I'll try that, though I'll have to figure out how to get the keyboard height (haven't turned anything up yet in Kitchen Sink or via Google). In the meantime, I added a footer to the table that gives it enough height to allow scrolling up to the last row when the keyboard is present:

    var footerView = Ti.UI.createView({
        height: 60
    tableview.footerView = footerView;
    — answered November 28th 2010 by Mark Pemburn
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.