UIKeyboardBoundsUserInfoKey is deprecated, what to use instead?

前端 未结 9 1752
我在风中等你
我在风中等你 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:29

    @Jason, you code if fine except for one point.

    At the moment you are not actually animating anything and the view will simply `pop' to its new size.height.

    You have to specify a state from which to animate. An animation is a sort of (from state)->(to state) thing.

    Luckily there is a very convenient method to specify the current state of the view as the (from state).

    [UIView setAnimationBeginsFromCurrentState:YES];
    

    If you add that line right after beginAnimations:context: your code works perfectly.

提交回复
热议问题