开发者

content offset for UIScrollView does not change while rotating and scrolling simultaneously

开发者 https://www.devze.com 2023-01-27 14:43 出处:网络
I have a UIScrollView开发者_JS百科 with paging enabled. Each page is of width 768.0px in portrait mode and 1024.0px in landscape mode.

I have a UIScrollView开发者_JS百科 with paging enabled.

Each page is of width 768.0px in portrait mode and 1024.0px in landscape mode.

If I am in the second page in the portrait mode, then the content offset for the UIScrollView is 768.0.

However, if I scroll to the next page and rotate the device to landscape at the same time, the content offset does not update and remains at 768.0 instead of the expected content offset 2048.0, giving wrong results.

Any idea on how i can invoke the scrollViewDidEndDecelerating: with the updated values?

Thanks in advance!


Check the rotation delegate methods for view controller which manages the scroll view. I'd suggest disabling user interaction while rotation is in progress (with willRotate... and didRotate... delegate methods) since you're doing frame resizing for scroll view and it's subviews.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号