这是由于ViewController有个
automaticallyAdjustsScrollViewInsets,将偏移把scrollView的contentOffset向下偏移了StatusBar + navigation bar的距离。
所以可以直接在 viewController的 viewDidLoad上调用
[self setAutomaticallyAdjustsScrollViewInsets:NO];
本文介绍了解决iOS应用中状态栏加导航栏导致的scrollView内容偏移问题的方法。通过设置automaticallyAdjustsScrollViewInsets属性为NO,可以避免scrollView的内容被额外下移。
automaticallyAdjustsScrollViewInsets,将偏移把scrollView的contentOffset向下偏移了StatusBar + navigation bar的距离。
所以可以直接在 viewController的 viewDidLoad上调用
[self setAutomaticallyAdjustsScrollViewInsets:NO];
1489

被折叠的 条评论
为什么被折叠?
