TextView TextField 上滑键盘
#pragma mark - 上滑键盘
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView{
    CGFloat offset = self.view.frame.size.height-(sayTextView.frame.origin.y+sayTextView.frame.size.height+216);
    if (offset<=0) {
        [UIView animateWithDuration:0.3 animations:^{
            CGRect frame = self.view.frame;
            frame.origin.y=offset;
            self.view.frame=frame;
        }];
    }
    return YES;
}

-(BOOL)textViewShouldEndEditing:(UITextView *)textView{
    [UIView animateWithDuration:0.3 animations:^{
        CGRect frame = self.view.frame;
        frame.origin.y=0.0;
        self.view.frame=frame;
    }];
    return YES;

阅读更多
文章标签: iOS键盘
个人分类: iOS
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

TextView TextField 上滑键盘

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭