Created
May 16, 2013 20:58
-
-
Save nwalter08/5595045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calculate the size of the tableView if it were to be dispalyed | |
[self.tableView layoutIfNeeded]; | |
// If the conent of the tableView is too small to scroll past the search bar... | |
if (self.tableView.contentSize.height < self.tableView.frame.size.height) { | |
// Add the difference and the height of the serachBarView to the bottom of the contentSize | |
CGFloat diff = self.tableView.frame.size.height - self.tableView.contentSize.height; | |
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, (diff + 44), 0); | |
} | |
// Scroll to the first section and the first row of the tableView | |
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment