Rectangle 27 0

iphone iOS AutoLayout issue with ScrollView?


I even tried plain out of the box master detail app using a UIScrollView instead of a table view as master, and was able to demonstrate the defect.

I think this might be a bug in iOS autolayout wrt UIScrollViews. I was having a similar problem only in my case, I would push to a detail view, then pop back to the master view which is a UIScrollView. Content in the scroll view would be shifted up. Scrolling the scroll view to the top, then pushing and popping again and things would be properly reset.

Table views and Collection views do not seem to have this problem.

Note
Rectangle 27 0

iphone iOS AutoLayout issue with ScrollView?


(void)layoutSubviews in an ViewController would not work

no sorry that was a sample code that i have written with copy paste the methods are wrong named

so i have found an compromise solution. when the viewController didDisappear was called i set the scrollView.contentOffset to y 0 and when the viewController viewDidAppear i set the contentOffset back to y 180 that would work

this was my first idea to reset the contentoffset in the viewWill Appear but i set the contentoffset to y 180 it would not work.

yeah you're right, sorry about that. Although you could try to make a custom UIView with layoutsubviews and see if it works better that way. I personally like to always do that. Anyway, is it really a popover you're showing? Because the method says openPopOver but I don't see any code about a popovercontroller?

Note