0
votes

I have UIScrollViews inside of cells of a UITableView. Everything is working as expected except... when I scroll a cell off the table view and then scroll it back, the UIScrollView that is now visible inside the cell, appears to have it's contentOffset shifted by half the width of the scroll view. But when I look at the contentOffset value, it is correct and has not been shifted. At this point, any adjustments to the contentOffset now have this shifted valued added to it. I'm stumped, does anyone have an idea how the images are getting shifting inside the UIScrollView? Or how i can fix this?

Also worth noting, I am using autoLayout and constraints to automatically set up the contentSize of the scrollView. That appears to be working as expected.

2

2 Answers

1
votes

Turns out autoLayout was my problem. For now I have turned off autoLayout for this view and directly set conentSize for the scrollView and the shifting bug goes away. Likely I am incorrectly setting up my constraints. Ideally I would have this working with autoLayout but for now I am going to have to leave it and possibly come back to it down the road.

0
votes

You don't need to set the contentSize i also had the same issue before. setTranslatesAutoresizing line should be deleted if you have added it