PDA

View Full Version : Scrolling Issue When Using On-Screen Keyboard




allanibanez
Feb 24, 2009, 07:11 AM
I've created a webapp that calculates the time and bearing of sunrise and sunset and have it running locally on my iPod via data:url. A problem I am having however is that when I input data into the page and the on-screen keyboard appears, this causes the page to scroll upwards. When I've finished typing and press done, whilst the keyboard scrolls away, the page doesn't scroll back to its original position.

I've included some pics which explain it much better.

How it should look:
http://allanibanez.comuf.com/images/Picture%204.png

Appearance when typing in:
http://allanibanez.comuf.com/images/Picture%205.png

Appearance after typing:
http://allanibanez.comuf.com/images/Picture%206.png

As you can see the page has scrolled and there is now a grey block of nothing at the bottom. Obviously a quick scroll corrects this, but I would quite like to have the page return to its existing state after the keyboard has been used.

Is there a solution / line of meta code that can do this?

Allan



dejo
Feb 24, 2009, 09:29 AM
Is there a solution / line of meta code that can do this?
Are you explicitly scrolling the view up when the picker appears? If so, just do the opposite when it disappears. If not, perhaps this thread can help:
Keyboard is hiding UITextField (http://forums.macrumors.com/showthread.php?t=635441)