I am trying to move a UITextView above the keyboard whenever the keyboard appears/changes. Let\'s say I have the English keyboard displaying and then switch directly to the Chin
- (void)keyboardDidAppear:(NSNotification *)note {
CGSize keyboardSize = [note.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, keyboardSize.height, 0.0);
textView.contentInset = contentInsets;
textView.scrollIndicatorInsets = contentInsets;
}
- (void)keyboardWillBeHidden:(NSNotification *)note {
UIEdgeInsets contentInsets = UIEdgeInsetsZero;
textView.contentInset = contentInsets;
textView.scrollIndicatorInsets = contentInsets;
}
The solution is from Apple's official solution here like 曹 said.