Here is the deal, I have a UITableView, and I add a custom cells with different elements like UITextFields and others that have a UITextView. When a textfield is clicked and the keyboard appears, I change the contentInset of my UITableView so the both, the keyboard and the textfield will be visible for the user.
The problem is that it seems to not work when I do this when the user click a UITextView! I try to change the contentinset but nothing happens. Here are some snipped codes.
PD: Im doing all the "register for remote not when the keyboard appears" thing. I will not add it here.
- (void)keyboardWasShown:(NSNotification*)aNotification {
NSDictionary* info = [aNotification userInfo];
self.keyboardSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
_uploadTableView.contentInset = UIEdgeInsetsMake(0, 0, _keyboardSize.height, 0); }
- (void)keyboardWillBeHidden:(NSNotification*)aNotification {
_uploadTableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); }
Along with changing the content insets, You need to scroll to row in which
UITextView
is present.In keyboardWasShown
In keyboardWillBeHidden