Scrolling Issue When Using On-Screen Keyboard

Discussion in 'iOS Programming' started by allanibanez, Feb 24, 2009.

  1. allanibanez macrumors regular

    Oct 11, 2008
    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: 4.png

    Appearance when typing in: 5.png

    Appearance after typing: 6.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?

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    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

Share This Page