Skip to content

Instantly share code, notes, and snippets.

@taktamur
Created August 5, 2014 14:46
Show Gist options
  • Save taktamur/d5bab93f798d7353e377 to your computer and use it in GitHub Desktop.
Save taktamur/d5bab93f798d7353e377 to your computer and use it in GitHub Desktop.
ステータスバーをタップした時に、一番上ではなく途中にスクロールさせたい時の書き方 ref: http://qiita.com/paming/items/fde55a74f4e98664322e
#pragma mark - UIScrollViewDelegate
- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
{
// section=1までスクロールする
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:1];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
// システム的な自動スクロールは停止
return NO;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment