I had an application in which I want to hide the navigation bar when scrolling up to UITableView. I do like this
- (void)scrollViewDidScroll:(UIScrollView *)sender {
UINavigationBar *navbar = self.navigationController.navigationBar;
UIView *tableView = self.view;
CGRect navBarFrame = self.navigationController.navigationBar.frame;
CGRect tableFrame = self.view.frame;
navBarFrame.origin.y = MIN(0, (sender.contentOffset.y * -1)) +20;
navbar.frame = navBarFrame;
tableFrame.origin.y = MIN(0,MAX(-44,(sender.contentOffset.y * -1)));
tableView.frame = tableFrame;
}
But the problem is that it is completely moving up in iOS 7. I need it to be stopped in the status bar, and the status bar is displayed there.
source
share