On iPhone 6, the contents of the scroll view do not match the width of the scroll view.

Asked 2 years ago, Updated 2 years ago, 80 views

The iOS app implements a scroll view by referring to the here article.

iOS 7 works fine, but iOS 8 iPhone 6 has a wider scrolling area than its parent view.

If you know the solution, please let me know.

The blue part of the image is the contents of the scroll view, and the red part is the scroll view.
The left is ideal, and the right is current.

Image Description

ios objective-c swift xcode

2022-09-30 20:50

2 Answers

It can be achieved by placing a constraint that "UIScrollView equals the width of its contents"
http://qiita.com/hirobe/items/2baf629b7807b4c0d10f


2022-09-30 20:50

I think the red frame corresponds to the frame of UIScrollView and the blue frame corresponds to the contentSize of UIScrollView.
The current information alone cannot determine why the move is unintended, but NSLog what values are in frame and contentSize and what values are in the frame and contentSize to find out if there is anything you can think of.


2022-09-30 20:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.