I have a table view with 3 sections, “Yesterday, Today, Tomorrow”. When the table view launches I want the “Today” section to be the upper most visible section. Therefore I use this function:
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1] atScrollPosition:UITableViewScrollPositionTop animated:NO];
This works fine when the table view is filled beyond its content size so it’s scrollable. The problem is when for example each section contain only 1 cell. Then the whole table will fit on the screen, and therefore the above code will not fire since it would rubberband back anyway.
Anyone know of a solution to this?
I’m answering this myself since there aren’t really any ideas.
From my understanding, this is impossible to achieve. The table view will try to scroll to the row if it can. Only way to make it work is to set the content size to be large enough for the table to scroll.