#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;
TextView TextField 上滑键盘
最新推荐文章于 2019-09-24 15:17:28 发布