How to identify the word toolbar at the top of the keyboard or not?

I am developing a chat application and I discovered a problem when a keyboard method appeared. I use UIKeyboardDidShowNotification to move the chat text and button on the keyboard. But the chat text box is hidden the toolbar of the word sugesstion when showing a word sentence or changing the keyboard to another language, for example, in Japanese. The keyboard height obtained by the UIKeyboardNotification is late. So, how do you determine if the toolbar tooltip is shown or not?

- (void)keyboardWasShown:(NSNotification*)aNotification
{
    NSDictionary *userInfo = [aNotification userInfo];
    CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
    CGRect rectTable = rTable;
    rectTable.origin.y -= kbSize.height;
    CGRect rectToolBar = rToolbar;
    rectToolBar.origin.y -= kbSize.height;

    [UIView animateWithDuration:0.25f
                     animations:^{
                         [self.tableView setFrame:rectTable];
                         [self.toolBar setFrame:rectToolBar];
                     }
    ];
}

If changing the location of the text view doen't work, is there any other way to place the textview on the keyboard?

+4
source share
2

,

CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;

CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
+10

, , [textview setScrollEnabled:NO] else set YES.

0

All Articles