Moving a text field when you click on it, use the code below. it only needs to exit your scroll
- (void)textFieldDidBeginEditing:(UITextField *)textField { self.scroll.contentOffset = CGPointMake(0, textField.frame.origin.y); }
you can change the position of the text field where the minus value of the y position should be displayed (textfield.frame.origin.y - some value)
If you want to revive the scroll, you can do it like this:
CGPoint newOffset = CGPointMake(0, textField.frame.origin.y-40); [self.scroll setContentOffset: newOffset animated: YES];
source share