Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)textFieldDidBeginEditing:(UITextField *)textField{
- NSLog(@"Se abrio el teclado");
- tmpRect = self.tableView.frame;
- [UIView beginAnimations:@"shrinkingTheTableView" context:nil];
- [UIView setAnimationCurve:UIViewAnimationCurveLinear];
- [UIView setAnimationDidStopSelector:@selector(finishedShrinkingTheTableView:finished:context:)];
- [UIView setAnimationDuration:0.25]; //I think .25 is the keyboard appearing animation duration
- self.tableView.frame = CGRectMake(tmpRect.origin.x, tmpRect.origin.y, tmpRect.size.width, tmpRect.size.height - 200);
- [UIView commitAnimations];
- }
- - (void)finishedShrinkingTheTableView:(NSString*)animationID finished:(BOOL)finished context:(void *)context {
- [self.tableView scrollToRowAtIndexPath:whateverTheIndexPathIs atScrollPosition:UITableViewScrollPositionTop animated:YES
- }
Add Comment
Please, Sign In to add comment