Hi,
Thanks for the reply! I think I should explain the problem again, I just cant find any awnser anywhere! :)
Code Block I have a UITableView with UITextField in each cells. The cells are not the same height, I have a small one dedicated to the name and a large one dedicated to the phone number... So, small-large small-large small-large and so on... |
I wish that if I select the small one to enter a name, the scroll action will unhide both small and large cell from the keyboard to be able to directly select the large one to enter the number...
If I select the large one, I want the scroll to only unhide this large cell from keyboard (the small one is before so visible).
The way I use is to store a value corresponding to the height of the large cell if I select a small one and 0 if I select a large one.
This value is updated fine, the only issue is that the delegate seems to keep only the first value active, so if the value changed, it wont scroll with this new value but with the old one...
So, if I hit return to dissmiss keyboard and select another textfield, everything is fine!
If I tap anywhere on the screen to dismiss keybord and then select a textfield, its fine too!
But if I select directly another textfield without escaping the active one to dissmiss the keyboard, it keeps the old value and not scroll correctly (exept if I select the same textfield size obviously).
IBAction , single tap etc are ok, all works exept for the part I described! When I select another textfield directly, the old one is deactivated and the new one activated correctly...
Here the code for the keyboard scroll:
Code Block -(void)keyboardWasShown: (NSNotification*)aNotification |
{ |
[UIView animateWithDuration:.3 |
animations:^(void) |
{ |
NSDictionary* info = [aNotification userInfo]; |
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey]CGRectValue].size; |
|
self.kbheight = kbSize.height; |
|
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0,0.0,(kbSize.height+self.cheatheight),0.0); |
self.table.contentInset = contentInsets; |
self.table.scrollIndicatorInsets = contentInsets; |
}]; |
} |
In the keyboardDidHide I just reset. It s like the keyboard dont dissmiss when I go from one textField to another directly, even if the field get deactivated...
Thanks!