I have set up a horizontal UIScrollView
in a UITableViewCell
prototype in my storyboard, along with its content views. I have made use of Autolayout.
In the -cellForRowAtIndexPath:
method, I am setting the contentSize
as well as contentOffset
for this scrollView.
The problem arises when the cells are created for the first time. Neither does the scrollView scroll, nor is the contentOffset taking place.
However, when I scroll down a few cells (when they start getting reused), the contentOffset takes place, and the scrollView is interactive.
Since I have subclassed the UITableViewCell
, I have tried setting the contentOffset in the -awakeFromNib
method, to no affect. I also tried doing so in the -tableView:willDisplayCell:
method to no avail.
What could be going wrong? Is there a workaround?
There doesn't seem to be any relevant code that I could include. Please comment if you need more info.
EDIT
I do not know whether this is relevant, but the Storyboard is showing a warning:
Scroll View: Has ambiguous scrollable content width