In my app, I have a navigation bar, a tab bar, a search bar and I always show the keypad.
However, with the different screen height with the iphone 5, I need to adjust the height of my table.
I can't anchor the table to the top of the keypad as this is shown a run time.
So I'm trying to do this dynamically, it looks like I'm missing the search bar, just too short, hmmm.
Perhaps there's an easier more obvious way?
EDIT: My code so far.
-(void)keyboardWillShow:(NSNotification*)aNotification {
int th = self.view.frame.size.height;
NSDictionary *info = [aNotification userInfo];
CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey]
CGRectValue].size;
int tableTop;
int tableHeight;
tableTop = table.frame.origin.y;
tableHeight = (th - tableTop) - kbSize.height;
[table setFrame:[General setTableBoundsByHeight:tableHeight:table]];
}
+ (CGRect)setTableBoundsByHeight:(int)lHeight:(UITableView*)tbl {
CGRect tableFrame = tbl.frame;
return CGRectMake(tableFrame.origin.x,
tableFrame.origin.y,
tableFrame.size.width,
lHeight);
}