ScrollView 自动偏移automaticallyAdjustsScrollViewInsets 无效
在导航条存在的时候ViewController中的第一个ScrollView类的对象,将向下偏移导航条的高度。
-
@available(iOS, introduced: 7.0, deprecated: 11.0, message: “Use UIScrollView’s contentInsetAdjustmentBehavior instead”)
open var automaticallyAdjustsScrollViewInsets: Bool
在iOS7-iOS11之间可以使用这个属性来改变是否需要自动偏移
iOS11之后 ScrollView 添加了contentInsetAdjustmentBehavior 属性
- 官方文档解释:
@available(iOS 11.0, *)
open var contentInsetAdjustmentBehavior: UIScrollView.ContentInsetAdjustmentBehavior