setContentOffset only works if animated is set to YES
- by Sheehan Alam
I have a UITableView which I would like to be displayed 100px down. For some reason this only works when animated is set to YES. Why is this?
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
/*[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]
atScrollPosition:UITableViewScrollPositionNone
animated:NO];*/
/*[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathWithIndex:1]
atScrollPosition:UITableViewScrollPositionNone
animated:NO];*/
[self.tableView setContentOffset:CGPointMake(0,100) animated:YES];
}