How do I determine the keyboard size

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

  1. mriddle macrumors newbie

    Joined:
    Jun 18, 2009
    #1
    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

    Jeremy1026

    Joined:
    Nov 3, 2007
    #2
    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

    kainjow

    Joined:
    Jun 15, 2000
    #3
    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

    Joined:
    Jun 18, 2009
    #4
    Thanks

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

Share This Page