在开发中遇到这样一个问题 就是在scrollview里的东西使劲往下拉 然后会掉下去大概一个导航条的高度。
而且在scrollview左右拖动的时候还会出现上下漂移的情况。
解决这种情况可以设置
self.automaticallyAdjustsScrollViewInsets = NO;//默认是YES
看一下官方文档:
automaticallyAdjustsScrollViewInsets
Specifies whether or not the view controller should automatically adjust its scroll view insets.
@property(nonatomic, assign) BOOL automaticallyAdjustsScrollViewInsets
Discussion
Default value is YES, which allows the view controller to adjust its scroll view insets in response to the screen areas consumed by the status bar, navigation bar, and toolbar or tab bar. Set toNO if you want to manage scroll view inset adjustments yourself, such as when there is more than one scroll view in the view hierarchy.
Availability
Available in iOS 7.0 and later.
Declared In
UIViewController.h
这个属性默认是YES,就是控制器