简体   繁体   中英

iOS 8 AutoLayout scrollview scrolls horizontally on iPhone 6 plus

I do have an App for iOS and while adapting all the UI to auto layout an size classes to support the new iPhone 6 and iPhone 6 plus i faced a weird issue... al my scrolls view work fine in iPhone 4s, 5, 5s and 6... in iPhone 6 plus they are not scrolling only vertically but also horizontally... like if the content size of the scroll view where a couple of pixel wider than the view itself (so it move horizontally of a couple of pixel and then it bounce). I do not understand why is this happening...

I finally found a proper way to let it work... I did it this way:

View hierarchy:
- UIView (Main view) - UIScrollView (which I wan of the same exact size of the Main view) - UIView (Container View containing all the stuff to be displayed in the scroll view)

Constraints:

Containar View:
- width equals to the one of the Main View - 0 leadin, trailing, top and bottom margin with superview (which is the Scroll View)

UIScrollView:
- width equals to the one of the Main View
- center view on X axis horizontally (center X)
- 0 top an bottom margin with superview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM