I have this line
[self.tableView scrollToRowAtIndexPath:self.cellIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
The cellIndexPath is section 2, row 0.
Instead of scrolling to the row it scrolls to the header of section 2.
Testing shows this seems to be the default behavior. Is there any way to override it and actually scroll to row 0?
Thanks
You could get the cell's rectangle and then scroll to that.
CGRect cellRect = [myTableView rectForRowAtIndexPath:cellIndexPath];
[myTableView setContentOffset:CGPointMake(0,(cellRect.origin.y)) animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With