How do I determine the keyboard size

Discussion in 'iOS Programming' started by mriddle, Jun 18, 2009.

  1. mriddle macrumors newbie

    Jun 18, 2009
    I'd like to make my program's view layout take into account the keyboard when it is visible - How can I determine its current height in both portrait and landscape mode from an API function? I'd rather not make guesses or hard code sizes.
  2. Jeremy1026 macrumors 68020


    Nov 3, 2007
    The keyboard dimensions are listed in the documentation. You just have to translate your view to move to support the keyboard.
  3. kainjow Moderator emeritus


    Jun 15, 2000
    Subscribe to the UIKeyboardDidShowNotification/UIKeyboardDidHideNotification notifications and then you can grab the UIKeyboardBoundsUserInfoKey value from the NSNotification's userInfo.
  4. mriddle thread starter macrumors newbie

    Jun 18, 2009

    The notification gave me the information in the way I wanted it - thank you.

Share This Page