I have added a scroll view to my view using IB. ScrollView contains text field and I scroll the UIScrollView programmatically upward when user taps on text field. My source code is below.
-(void)textFieldDidEndEditing:(UITextField *)textField{
[inviteFriendScrollView setContentOffset:CGPointMake(0, 0) animated:YES];
}
-(void)textFieldDidBeginEditing:(UITextField *)textField{
[inviteFriendScrollView setContentOffset:CGPointMake(0, 30) animated:YES];
}
This code works fine on simulator but when I try this on the device (my device is iOS 5.0), scroll does not move upward or downward though above code executes. I have noticed that if I change animated:YES to animated:NO, the code works fine on device as well.
Can anyone please tell me why animated scrolling is not working on device?
Best Regards