Reputation: 15
I created a tableview and it works normally as intended. However, I would like to change the scrolling such a way where the user can only scroll one cell at a time so that, there is never a time where the cell is cut in half..
This is an example: https://i.sstatic.net/LIYGN.jpg
So basically i do not want the default scrolling.. i would like it to be scrolled one cell at a time to constantly remain with the view of the original state..
Is there a way?
Upvotes: 1
Views: 1727
Reputation: 73
how about this ?
scrollToNearestSelectedRowAtScrollPosition:animated:
?
tableview scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];
Upvotes: 1
Reputation: 657
you can use viewWillTransition function for that to stop that issue..
verride func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator){}
Upvotes: 0