TPKeyboardAvoiding
TPKeyboardAvoiding copied to clipboard
Text frame "jumps" on resignFirstResponder when not using UIReturnKeyDefault
This can be observed using the provided sample application and making the following changes to TPKAScrollViewController
- Modify the returnKeyType and set the delegate for each UITextField
textField.returnKeyType = UIReturnKeyDone;
textField.delegate = self;
- Implement
-(BOOL)textFieldShouldReturn:(UITextField *)textField
to dismiss keyboard
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return true;
}
Type in any field and click the Done button. The _UITextContentView frame jumps to the left briefly before returning to its original position.
This was introduced in build 1.2.4 by adding [self layoutIfNeeded]
to -TPKeyboardAvoiding_keyboardWillShow:
in commit f533c6c. I see that the issue this was intended to address was "Scrollview stuttering problem on content inset/offset change fixed." Removing this code fixes the text jumping when resigning first responder status, but what are the ramifications?