1
Create delegate for textfields and Iboutlet for scroll and use the following code:
SWIFT:
func textFieldDidBeginEditing(textField : UITextField)
{
var pt : CGPoint
var rc = textField.bounds
rc = textField.convertRect(rc, toView: self.scroll)
pt = rc.origin;
pt.x = 0;
pt.y -= 157; // Ajuste de acordo com a necessidade
self.scroll.setContentOffset(pt, animated: true)
}
OBJECTIVE-C
- (void)textViewDidBeginEditing:(UITextField *)textField
{
CGPoint pt;
CGRect rc = [textField bounds];
rc = [textField convertRect:rc toView:self.scroll];
pt = rc.origin;
pt.x = 0;
pt.y -= 157; // Ajuste de acordo com a necessidade
[self.scroll setContentOffset:pt animated:YES];
}
Take a look in this answer, has a library tip that solves this your question.
– Paulo Rodrigues
Thank you Paulo, I will try here and I warn if you have succeeded!
– CristianCotrena