作者:国际物流-Ann | 来源:互联网 | 2023-05-16 13:05
#pragma-markUITextViewDelegate-(void)textViewDidEndEditing:(UITextView*)textView{
#pragma -mark UITextView Delegate
- (void)textViewDidEndEditing:(UITextView *)textView{
self.view.frame = CGRectMake(0, 0, ScreenW, ScreenH);
}
-(void)textViewDidBeginEditing:(UITextView *)textView{
CGRect frame = textView.frame;
int offset = (frame.origin.y+62)-(ScreenH-216.0);
[UIView beginAnimations:@"ResizeForKeyboard" context:nil];
[UIView setAnimationDuration:0.30f];
if (offset>0) {
self.view.frame = CGRectMake(0.0f, -offset, ScreenW, ScreenH);
}
[UIView commitAnimations];
}
#pragma -mark UITextField Delegate
-(void)textFieldDidBeginEditing:(UITextField *)textField{
}