automaticallyAdjustsScrollViewInsets
- automaticallyAdjustsScrollViewInsets是ViewController的一个属性,指示VIewController是否需要自动调整ScrollViewInsets。
- 默认值为YES,允许ViewController自动调整ScrollViewInsets
VC对ScrollView的调整
- 当automaticallyAdjustsScrollViewInsets值为YES时,viewController根据当前view中statusBar,navigaionTionBar,toolBar或者toolBar来自动调整scrollView的的contentInset和ContentOffset。使得scrollView的内容不会被这些Bar遮挡
- 具体通过_setNavigationControllerContentInsetAdjustment相关函数实现
示例
- 在一个由TabBarController导出的被Navigation封装的VC中拖一个tableview 铺满VC的View,不会被导航挡住64像素的高度。采用KVO观察
- contentInset的top增加了statusBar高度+Naviga