开发者社区 问答 正文

关于点击键盘,手势会穿透键盘,点击到键盘底下的Cell,这是什么原因?

点击键盘,手势会穿透键盘,点击到键盘底下的Cell,这是什么原因?

展开
收起
爵霸 2016-03-13 09:37:55 1952 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • 当键盘显示或消失时,系统会发送相关的通知:

     UIKeyboardWillShowNotification
     UIKeyboardDidShowNotification
     UIKeyboardWillHideNotification
     UIKeyboardDidHideNotification

    截取通知

     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    (void)keyboardWillShow:(NSNotification *)noti {
     //键盘输入的界面调整
     //键盘的高度 float height = 216.0;
     CGRect frame = self.view.frame;
     frame.size = CGSizeMake(frame.size.width, frame.size.height - height);
     [UIView beginAnimations:@"Curl"context:nil];//动画开始
     [UIView setAnimationDuration:0.30];
     [UIView setAnimationDelegate:self];
     [self.view setFrame:frame];
     [UIView commitAnimations]; }

    大概就是这么个思路

    2019-07-17 19:01:47 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等