【发布时间】:2013-09-12 22:30:29
【问题描述】:
我在 Interface Builder 中有一个 UIViewController,我在 UIView 中添加了一个 UIScrollView。它的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
这种行为的原因是什么?我刚刚在 IB 中添加了一个 UIScrollView 并且根本没有在代码中做任何事情。
scrollView 的contentHeight 大于self.view.height。 scrollView 的frame 保持不变。
【问题讨论】:
标签: ios cocoa-touch uiview uiscrollview interface-builder