automaticallyAdjustsScrollViewInsets
2016-04-09 15:57
232 查看
对于automaticallyAdjustsScrollViewInsets 的官方描述是:
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.//iOS7.0之后的属性!!!
Declared In
UIViewController.h
简单点说就是automaticallyAdjustsScrollViewInsets根据按所在界面的status bar,navigationbar,与tabbar的高度,自动调整scrollview的 inset,设置为no,不让viewController调整。
self.automaticallyAdjustsScrollViewInsets = NO; // scrollview 上的视图view(y+)自动下移navigationbar,与tabbar的高度。(无论这scrollview是否置顶)
自己代码的问题在于自定义了一个 navigationbar ,因而系统自己判断并适配。设置了
automaticallyAdjustsScrollViewInsets 才实现了相应效果。
备注一下UIScrollView的一些属性
常见属性
CGSize contentSize :设置UIScrollView的滚动范围
CGPoint contentOffset :UIScrollView当前滚动的位置
UIEdgeInsets contentInset :这个属性可以在四周增加滚动范围
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.//iOS7.0之后的属性!!!
Declared In
UIViewController.h
简单点说就是automaticallyAdjustsScrollViewInsets根据按所在界面的status bar,navigationbar,与tabbar的高度,自动调整scrollview的 inset,设置为no,不让viewController调整。
self.automaticallyAdjustsScrollViewInsets = NO; // scrollview 上的视图view(y+)自动下移navigationbar,与tabbar的高度。(无论这scrollview是否置顶)
自己代码的问题在于自定义了一个 navigationbar ,因而系统自己判断并适配。设置了
automaticallyAdjustsScrollViewInsets 才实现了相应效果。
备注一下UIScrollView的一些属性
常见属性
CGSize contentSize :设置UIScrollView的滚动范围
CGPoint contentOffset :UIScrollView当前滚动的位置
UIEdgeInsets contentInset :这个属性可以在四周增加滚动范围
相关文章推荐
- 【LeetCode】75. Sort Colors解法及注释
- ES2015/ES6常用新特性
- zoj 3209 Treasure Map dancing links
- 网络流题集
- 关于RunLoop的几点个人看法
- Raising Modulo Numbers(数论)
- LeetCode *** 172. Factorial Trailing Zeroes
- SSH2+ajax+jsp登录源码
- centos7 安装及配置
- IIS安装Web Deploy之后没有显示右键菜单
- leetcode 80 Remove Duplicates from Sorted Array II
- 使用Mathematica操作控制Excel - Mathematica Link for Excel操作详解
- Tarjan&LCA题集
- 排序算法之直接插入排序和希尔排序
- solr5.5之从数据库中导入数据并建立索引
- ahu-730-幸运抽奖
- 车牌识别--S5PV210測试
- Highcharts混合图(2个Y轴)——结合后台数据
- 树型dp
- Android 第十一天重置版_新特性