Friday, November 22, 2013

iOS7: Scroll to Top

Should be simple right?
self.tableView.contentOffset = CGRectZero;
However, on iOS7 your tableView will end up with its top part hidden under the navigation bar. Instead, you need to do this:
self.tableView.contentOffset = CGPointMake(0, -self.tableView.contentInset.top);

No comments:

Post a Comment