trying to add done button to Numeric keyboard

前端 未结 4 910
星月不相逢
星月不相逢 2020-12-16 21:22

I\'m trying to add a \"done\" button to the UIKeyboadnumpad, but with no success. What\'s wrong in my code?

the keyboard don\'t have the done button

         


        
4条回答
  •  执笔经年
    2020-12-16 22:00

    Write your add button's code in - (void)keyboardDidShow:(NSNotification *)note

    instead of

    - (void)keyboardWillShow:(NSNotification *)note 
    

    For this implement UIKeyboardDidShowNotification notification like :

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) 
                                                         name:UIKeyboardDidShowNotification object:nil];
    

    I think UIView* keyboard; is not getting the keyboard's view as keyboard is not displayed yet, it will display !!!

提交回复
热议问题