UIKeyboardBoundsUserInfoKey is deprecated, what to use instead?

前端 未结 9 1768
我在风中等你
我在风中等你 2020-12-02 04:56

I\'m working on an iPad app using 3.2 sdk. I\'m dealing with obtaining the keyboard size to prevent my textfields from hidding behind it.

I\'m getting a Warning in

9条回答
  •  庸人自扰
    2020-12-02 05:42

    You simply use this code:

    //NSVale *aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];
    //instead of Upper line we can use either next line or nextest line.
    //NSValue *aValue = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
    NSValue *aValue = [info objectForKey:UIKeyboardFrameBeginUserInfoKey];
    

提交回复
热议问题