您的位置:首页 > 其它

TextView TextField 上滑键盘

2015-11-18 18:00 239 查看
#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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: