美文网首页
获取键盘的y

获取键盘的y

作者: 杨大虾 | 来源:发表于2017-06-12 14:18 被阅读8次

    1.监听键盘

        [[NSNotificationCenter defaultCenter] addObserver:view selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    
    - (void)keyboardWillShow:(NSNotification *)notification{
        //取得键盘最后的frame
        CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
        CGFloat height = keyboardFrame.origin.y;
        
    }
    

    相关文章

      网友评论

          本文标题:获取键盘的y

          本文链接:https://www.haomeiwen.com/subject/peklqxtx.html