我有一个UIViewController
在 Interface Builder 中,我添加了一个UIScrollView
to the UIView
。它有一个contentOffset
属性等于 0.0,但是当我滚动UIScrollView
到最底部并推另一个视图contentOffset
变化。
NSLog
给我以下值:
//View just loaded
2013-09-09 16:19:27.455 my_app[24588:907] Scroll View content offset is 0.000000
//We came back from another view
2013-09-09 16:19:30.957 my_app[24588:907] Scroll View content offset is 108.000000
这种行为的原因是什么?我刚刚添加了一个UIScrollView
在IB中并且在代码中根本没有做任何事情。
The contentHeight
的scrollView大于self.view.height
. The frame
的scrollView保持不变。
适用于 iOS 7/8self.automaticallyAdjustsScrollViewInsets = NO;
解决了问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)