iOS的自动版式8滚动型水平滚动的iPhone 6加 [英] iOS 8 AutoLayout scrollview scrolls horizontally on iPhone 6 plus
问题描述
我有适用于iOS的应用程序,并同时适应所有的UI自动布局的规模类以支持新的iPhone 6和iPhone 6再加上我遇到一个奇怪的问题......我的人滚动查看iPhone 4S做工精细, 5,5S和6 ...在iPhone 6再加上他们没有如果滚动视图的内容大小,其中一对夫妇像素比视图本身更广泛的(所以它水平移动的滚动只会垂直而且水平......像情侣像素,然后反弹)。
我不明白为什么会这样...
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:
查看层次结构:
- UIView的(主视图)
- 的UIScrollView(我婉主视图完全相同的大小)
- UIView的(容器视图包含所有东西显示在滚动视图)
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)
约束:
Containar查看:
- 宽度等于主视图之一
- 0导入区,尾随,与上海华顶和底边距(这是滚动视图)
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中:
- 宽度等于主视图
之一
- 在X轴中心查看水平(中心X)
- 0顶配的SuperView的底部边缘
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
这篇关于iOS的自动版式8滚动型水平滚动的iPhone 6加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!