Open DrBeak1 opened 10 years ago
I solved this by preventing the toolbar from going lower than the bottom of the current viewControllers View.
float lowestToolbarY = 620.0 - self.commentToolbar.bounds.size.height - self.navigationController.navigationBar.bounds.size.height;
[self.view addKeyboardPanningWithActionHandler:^(CGRect keyboardFrameInView) {
CGRect toolBarFrame = toolBar.frame;
toolBarFrame.origin.y = keyboardFrameInView.origin.y - toolBarFrame.size.height;
if (toolBarFrame.origin.y >=lowestToolbarY) {
toolBarFrame.origin.y = lowestToolbarY;
}
toolBar.frame = toolBarFrame;
CGRect tableViewFrame = tableView.frame;
tableViewFrame.size.height = toolBarFrame.origin.y;
tableView.frame = tableViewFrame;
}];
The issue I'm running into is that when the keyboard is dismissed the toolbar goes down and disappears off the screen. Any ideas on how to fix this?
Thanks in advance.