Keyboard in the way; Need to hide it - or - be able scroll up to see covered fields
Hi,
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.
Thanks,
Mark
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.
-
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;