How to add Chinese keyboard support with UITextView on iOS 7 ? I am currently using the following code. But it only works correctly for standard size keyboards. It resizes the UITextView only for the main keyboard without an additional Chinese panel.
bool keyboardIsShown; float keyboardDelta; - (void)keyboardWillShow:(NSNotification*)aNotification { if (!keyboardIsShown) { keyboardIsShown = true; NSDictionary* userInfo = [aNotification userInfo]; CGSize keyboardSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; if (is_Landscape) { keyboardSize = CGSizeMake(keyboardSize.height, keyboardSize.width); } keyboardSize.height -= tabBarController.tabBar.frame.size.height; CGRect viewFrame = myUITextView.frame; keyboardDelta = keyboardSize.height; viewFrame.size.height -= keyboardDelta; NSTimeInterval animationDuration; UIViewAnimationCurve animationCurve; [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve]; [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationCurve:animationCurve]; [UIView setAnimationDuration:animationDuration]; [myUITextView setFrame:viewFrame]; [UIView commitAnimations]; } } - (void)keyboardWillHide:(NSNotification*)aNotification { keyboardIsShown = false; CGRect viewFrame = editor.frame; viewFrame.size.height += keyboardDelta; NSDictionary* userInfo = [aNotification userInfo]; NSTimeInterval animationDuration; UIViewAnimationCurve animationCurve; [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve]; [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationCurve:animationCurve]; [UIView setAnimationDuration:animationDuration]; [myUITextView setFrame:viewFrame]; [UIView commitAnimations]; }
source share